├── .clang-format ├── .codecov.yml ├── .git-blame-ignore-revs ├── .gitattributes ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ └── feature_request.md ├── actions │ ├── build │ │ └── action.yml │ └── dependencies │ │ └── action.yml ├── pull_request_template.md └── workflows │ ├── clang-format.yml │ ├── doxygen.yml │ ├── levelization.yml │ ├── libxrpl.yml │ ├── macos.yml │ ├── missing-commits.yml │ ├── nix.yml │ └── windows.yml ├── .gitignore ├── .pre-commit-config.yaml ├── API-CHANGELOG.md ├── BUILD.md ├── Builds └── levelization │ ├── README.md │ ├── levelization.sh │ └── results │ ├── loops.txt │ └── ordering.txt ├── CMakeLists.txt ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── RELEASENOTES.md ├── SECURITY.md ├── bin ├── browser.js ├── debug_local_sign.js ├── email_hash.js ├── flash_policy.js ├── getRippledInfo ├── git │ ├── setup-upstreams.sh │ ├── squash-branches.sh │ └── update-version.sh ├── hexify.js ├── jsonrpc_request.js ├── jsonrpc_server.js ├── physical.sh ├── rlint.js ├── sh │ ├── install-vcpkg.sh │ └── setup-msvc.sh ├── start_sync_stop.py ├── stop-test.js └── update_binformat.js ├── cfg ├── rippled-example.cfg └── validators-example.txt ├── cmake ├── CMakeFuncs.cmake ├── CodeCoverage.cmake ├── RippleConfig.cmake ├── RippledCompiler.cmake ├── RippledCore.cmake ├── RippledCov.cmake ├── RippledDocs.cmake ├── RippledInstall.cmake ├── RippledInterface.cmake ├── RippledSanity.cmake ├── RippledSettings.cmake ├── RippledValidatorKeys.cmake ├── RippledVersion.cmake ├── add_module.cmake ├── create_symbolic_link.cmake ├── deps │ └── Boost.cmake ├── isolate_headers.cmake ├── target_link_modules.cmake └── target_protobuf_sources.cmake ├── conanfile.py ├── docs ├── .gitignore ├── 0001-negative-unl │ ├── README.md │ ├── negativeUNLSqDiagram.puml │ └── negativeUNL_highLevel_sequence.png ├── 0010-ledger-replay │ ├── README.md │ ├── ledger_replay_classes.png │ ├── ledger_replay_classes.puml │ ├── ledger_replay_sequence.png │ └── ledger_replay_sequence.puml ├── CheatSheet.md ├── CodingStyle.md ├── Docker.md ├── Doxyfile ├── HeapProfiling.md ├── NodeStoreRefactoringCaseStudy.pdf ├── README.md ├── build │ ├── conan.md │ ├── depend.md │ ├── environment.md │ └── install.md ├── consensus.md ├── images │ ├── consensus │ │ ├── EffCloseTime.png │ │ ├── block_chain.png │ │ ├── consensus_modes.png │ │ ├── consensus_overview.png │ │ ├── disputes.png │ │ ├── ledger_chain.png │ │ └── threshold.png │ └── xrp-text-mark-black-small@2x.png └── sample_chart.doc ├── external ├── README.md ├── antithesis-sdk │ ├── .clang-format │ ├── CMakeLists.txt │ ├── LICENSE │ ├── README.md │ ├── antithesis_instrumentation.h │ └── antithesis_sdk.h ├── ed25519-donna │ ├── CMakeLists.txt │ ├── README.md │ ├── curve25519-donna-32bit.h │ ├── curve25519-donna-64bit.h │ ├── curve25519-donna-helpers.h │ ├── curve25519-donna-sse2.h │ ├── ed25519-donna-32bit-sse2.h │ ├── ed25519-donna-32bit-tables.h │ ├── ed25519-donna-64bit-sse2.h │ ├── ed25519-donna-64bit-tables.h │ ├── ed25519-donna-64bit-x86-32bit.h │ ├── ed25519-donna-64bit-x86.h │ ├── ed25519-donna-basepoint-table.h │ ├── ed25519-donna-batchverify.h │ ├── ed25519-donna-impl-base.h │ ├── ed25519-donna-impl-sse2.h │ ├── ed25519-donna-portable-identify.h │ ├── ed25519-donna-portable.h │ ├── ed25519-donna.h │ ├── ed25519-hash-custom.h │ ├── ed25519-hash.h │ ├── ed25519-randombytes-custom.h │ ├── ed25519-randombytes.h │ ├── ed25519.c │ ├── ed25519.h │ ├── fuzz │ │ ├── README.md │ │ ├── build-nix.php │ │ ├── curve25519-ref10.c │ │ ├── curve25519-ref10.h │ │ ├── ed25519-donna-sse2.c │ │ ├── ed25519-donna.c │ │ ├── ed25519-donna.h │ │ ├── ed25519-ref10.c │ │ ├── ed25519-ref10.h │ │ ├── fuzz-curve25519.c │ │ └── fuzz-ed25519.c │ ├── modm-donna-32bit.h │ ├── modm-donna-64bit.h │ ├── regression.h │ ├── test-internals.c │ ├── test-ticks.h │ └── test.c ├── nudb │ ├── conandata.yml │ ├── conanfile.py │ └── patches │ │ └── 2.0.8-0001-add-include-stdexcept-for-msvc.patch ├── rocksdb │ ├── conandata.yml │ ├── conanfile.py │ └── patches │ │ ├── 9.7.3-0001-memory-leak.patch │ │ └── 9.x.x-0001-exclude-thirdparty.patch ├── secp256k1 │ ├── .cirrus.yml │ ├── .gitattributes │ ├── .gitignore │ ├── CHANGELOG.md │ ├── CMakeLists.txt │ ├── CMakePresets.json │ ├── CONTRIBUTING.md │ ├── COPYING │ ├── Makefile.am │ ├── README.md │ ├── SECURITY.md │ ├── autogen.sh │ ├── build-aux │ │ └── m4 │ │ │ └── bitcoin_secp.m4 │ ├── ci │ │ ├── ci.sh │ │ └── linux-debian.Dockerfile │ ├── cmake │ │ ├── CheckArm32Assembly.cmake │ │ ├── CheckMemorySanitizer.cmake │ │ ├── CheckStringOptionValue.cmake │ │ ├── CheckX86_64Assembly.cmake │ │ ├── FindValgrind.cmake │ │ ├── GeneratePkgConfigFile.cmake │ │ ├── TryAppendCFlags.cmake │ │ ├── arm-linux-gnueabihf.toolchain.cmake │ │ ├── config.cmake.in │ │ ├── source_arm32.s │ │ └── x86_64-w64-mingw32.toolchain.cmake │ ├── configure.ac │ ├── contrib │ │ ├── lax_der_parsing.c │ │ ├── lax_der_parsing.h │ │ ├── lax_der_privatekey_parsing.c │ │ └── lax_der_privatekey_parsing.h │ ├── doc │ │ ├── ellswift.md │ │ ├── musig.md │ │ ├── release-process.md │ │ └── safegcd_implementation.md │ ├── examples │ │ ├── CMakeLists.txt │ │ ├── EXAMPLES_COPYING │ │ ├── ecdh.c │ │ ├── ecdsa.c │ │ ├── ellswift.c │ │ ├── examples_util.h │ │ ├── musig.c │ │ └── schnorr.c │ ├── include │ │ ├── secp256k1.h │ │ ├── secp256k1_ecdh.h │ │ ├── secp256k1_ellswift.h │ │ ├── secp256k1_extrakeys.h │ │ ├── secp256k1_musig.h │ │ ├── secp256k1_preallocated.h │ │ ├── secp256k1_recovery.h │ │ └── secp256k1_schnorrsig.h │ ├── libsecp256k1.pc.in │ ├── sage │ │ ├── gen_exhaustive_groups.sage │ │ ├── gen_split_lambda_constants.sage │ │ ├── group_prover.sage │ │ ├── prove_group_implementations.sage │ │ ├── secp256k1_params.sage │ │ └── weierstrass_prover.sage │ ├── src │ │ ├── CMakeLists.txt │ │ ├── asm │ │ │ └── field_10x26_arm.s │ │ ├── assumptions.h │ │ ├── bench.c │ │ ├── bench.h │ │ ├── bench_ecmult.c │ │ ├── bench_internal.c │ │ ├── checkmem.h │ │ ├── ctime_tests.c │ │ ├── ecdsa.h │ │ ├── ecdsa_impl.h │ │ ├── eckey.h │ │ ├── eckey_impl.h │ │ ├── ecmult.h │ │ ├── ecmult_compute_table.h │ │ ├── ecmult_compute_table_impl.h │ │ ├── ecmult_const.h │ │ ├── ecmult_const_impl.h │ │ ├── ecmult_gen.h │ │ ├── ecmult_gen_compute_table.h │ │ ├── ecmult_gen_compute_table_impl.h │ │ ├── ecmult_gen_impl.h │ │ ├── ecmult_impl.h │ │ ├── field.h │ │ ├── field_10x26.h │ │ ├── field_10x26_impl.h │ │ ├── field_5x52.h │ │ ├── field_5x52_impl.h │ │ ├── field_5x52_int128_impl.h │ │ ├── field_impl.h │ │ ├── group.h │ │ ├── group_impl.h │ │ ├── hash.h │ │ ├── hash_impl.h │ │ ├── hsort.h │ │ ├── hsort_impl.h │ │ ├── int128.h │ │ ├── int128_impl.h │ │ ├── int128_native.h │ │ ├── int128_native_impl.h │ │ ├── int128_struct.h │ │ ├── int128_struct_impl.h │ │ ├── modinv32.h │ │ ├── modinv32_impl.h │ │ ├── modinv64.h │ │ ├── modinv64_impl.h │ │ ├── modules │ │ │ ├── ecdh │ │ │ │ ├── Makefile.am.include │ │ │ │ ├── bench_impl.h │ │ │ │ ├── main_impl.h │ │ │ │ └── tests_impl.h │ │ │ ├── ellswift │ │ │ │ ├── Makefile.am.include │ │ │ │ ├── bench_impl.h │ │ │ │ ├── main_impl.h │ │ │ │ ├── tests_exhaustive_impl.h │ │ │ │ └── tests_impl.h │ │ │ ├── extrakeys │ │ │ │ ├── Makefile.am.include │ │ │ │ ├── main_impl.h │ │ │ │ ├── tests_exhaustive_impl.h │ │ │ │ └── tests_impl.h │ │ │ ├── musig │ │ │ │ ├── Makefile.am.include │ │ │ │ ├── keyagg.h │ │ │ │ ├── keyagg_impl.h │ │ │ │ ├── main_impl.h │ │ │ │ ├── session.h │ │ │ │ ├── session_impl.h │ │ │ │ ├── tests_impl.h │ │ │ │ └── vectors.h │ │ │ ├── recovery │ │ │ │ ├── Makefile.am.include │ │ │ │ ├── bench_impl.h │ │ │ │ ├── main_impl.h │ │ │ │ ├── tests_exhaustive_impl.h │ │ │ │ └── tests_impl.h │ │ │ └── schnorrsig │ │ │ │ ├── Makefile.am.include │ │ │ │ ├── bench_impl.h │ │ │ │ ├── main_impl.h │ │ │ │ ├── tests_exhaustive_impl.h │ │ │ │ └── tests_impl.h │ │ ├── precompute_ecmult.c │ │ ├── precompute_ecmult_gen.c │ │ ├── precomputed_ecmult.c │ │ ├── precomputed_ecmult.h │ │ ├── precomputed_ecmult_gen.c │ │ ├── precomputed_ecmult_gen.h │ │ ├── scalar.h │ │ ├── scalar_4x64.h │ │ ├── scalar_4x64_impl.h │ │ ├── scalar_8x32.h │ │ ├── scalar_8x32_impl.h │ │ ├── scalar_impl.h │ │ ├── scalar_low.h │ │ ├── scalar_low_impl.h │ │ ├── scratch.h │ │ ├── scratch_impl.h │ │ ├── secp256k1.c │ │ ├── selftest.h │ │ ├── testrand.h │ │ ├── testrand_impl.h │ │ ├── tests.c │ │ ├── tests_exhaustive.c │ │ ├── testutil.h │ │ ├── util.h │ │ └── wycheproof │ │ │ ├── WYCHEPROOF_COPYING │ │ │ ├── ecdsa_secp256k1_sha256_bitcoin_test.h │ │ │ └── ecdsa_secp256k1_sha256_bitcoin_test.json │ └── tools │ │ ├── check-abi.sh │ │ ├── test_vectors_musig2_generate.py │ │ └── tests_wycheproof_generate.py ├── snappy │ ├── conandata.yml │ ├── conanfile.py │ └── patches │ │ ├── 1.1.10-0001-fix-inlining-failure.patch │ │ ├── 1.1.10-0003-fix-clobber-list-older-llvm.patch │ │ ├── 1.1.9-0001-fix-inlining-failure.patch │ │ ├── 1.1.9-0002-no-Werror.patch │ │ ├── 1.1.9-0003-fix-clobber-list-older-llvm.patch │ │ └── 1.1.9-0004-rtti-by-default.patch └── soci │ ├── conandata.yml │ ├── conanfile.py │ └── patches │ ├── 0001-Remove-hardcoded-INSTALL_NAME_DIR-for-relocatable-li.patch │ └── 0002-Fix-soci_backend.patch ├── include └── xrpl │ ├── basics │ ├── Archive.h │ ├── BasicConfig.h │ ├── Blob.h │ ├── Buffer.h │ ├── ByteUtilities.h │ ├── CompressionAlgorithms.h │ ├── CountedObject.h │ ├── DecayingSample.h │ ├── Expected.h │ ├── FileUtilities.h │ ├── IntrusivePointer.h │ ├── IntrusivePointer.ipp │ ├── IntrusiveRefCounts.h │ ├── KeyCache.h │ ├── LocalValue.h │ ├── Log.h │ ├── MathUtilities.h │ ├── Number.h │ ├── README.md │ ├── RangeSet.h │ ├── Resolver.h │ ├── ResolverAsio.h │ ├── SHAMapHash.h │ ├── SharedWeakCachePointer.h │ ├── SharedWeakCachePointer.ipp │ ├── SlabAllocator.h │ ├── Slice.h │ ├── StringUtilities.h │ ├── TaggedCache.h │ ├── TaggedCache.ipp │ ├── ToString.h │ ├── UnorderedContainers.h │ ├── UptimeClock.h │ ├── algorithm.h │ ├── base64.h │ ├── base_uint.h │ ├── chrono.h │ ├── comparators.h │ ├── contract.h │ ├── hardened_hash.h │ ├── join.h │ ├── make_SSLContext.h │ ├── mulDiv.h │ ├── partitioned_unordered_map.h │ ├── random.h │ ├── safe_cast.h │ ├── scope.h │ ├── spinlock.h │ ├── strHex.h │ └── tagged_integer.h │ ├── beast │ ├── asio │ │ └── io_latency_probe.h │ ├── clock │ │ ├── abstract_clock.h │ │ ├── basic_seconds_clock.h │ │ └── manual_clock.h │ ├── container │ │ ├── aged_container.h │ │ ├── aged_container_utility.h │ │ ├── aged_map.h │ │ ├── aged_multimap.h │ │ ├── aged_multiset.h │ │ ├── aged_set.h │ │ ├── aged_unordered_map.h │ │ ├── aged_unordered_multimap.h │ │ ├── aged_unordered_multiset.h │ │ ├── aged_unordered_set.h │ │ └── detail │ │ │ ├── aged_associative_container.h │ │ │ ├── aged_container_iterator.h │ │ │ ├── aged_ordered_container.h │ │ │ ├── aged_unordered_container.h │ │ │ └── empty_base_optimization.h │ ├── core │ │ ├── CurrentThreadName.h │ │ ├── LexicalCast.h │ │ ├── List.h │ │ ├── LockFreeStack.h │ │ └── SemanticVersion.h │ ├── hash │ │ ├── hash_append.h │ │ ├── uhash.h │ │ └── xxhasher.h │ ├── insight │ │ ├── Collector.h │ │ ├── Counter.h │ │ ├── CounterImpl.h │ │ ├── Event.h │ │ ├── EventImpl.h │ │ ├── Gauge.h │ │ ├── GaugeImpl.h │ │ ├── Group.h │ │ ├── Groups.h │ │ ├── Hook.h │ │ ├── HookImpl.h │ │ ├── Insight.h │ │ ├── Meter.h │ │ ├── MeterImpl.h │ │ ├── NullCollector.h │ │ └── StatsDCollector.h │ ├── net │ │ ├── IPAddress.h │ │ ├── IPAddressConversion.h │ │ ├── IPAddressV4.h │ │ ├── IPAddressV6.h │ │ └── IPEndpoint.h │ ├── rfc2616.h │ ├── test │ │ └── yield_to.h │ ├── type_name.h │ ├── unit_test.h │ ├── unit_test │ │ ├── amount.h │ │ ├── detail │ │ │ └── const_container.h │ │ ├── global_suites.h │ │ ├── match.h │ │ ├── recorder.h │ │ ├── reporter.h │ │ ├── results.h │ │ ├── runner.h │ │ ├── suite.h │ │ ├── suite_info.h │ │ ├── suite_list.h │ │ └── thread.h │ ├── utility │ │ ├── Journal.h │ │ ├── PropertyStream.h │ │ ├── WrappedSink.h │ │ ├── Zero.h │ │ ├── instrumentation.h │ │ ├── maybe_const.h │ │ ├── rngfill.h │ │ └── temp_dir.h │ └── xor_shift_engine.h │ ├── crypto │ ├── README.md │ ├── RFC1751.h │ ├── csprng.h │ └── secure_erase.h │ ├── json │ ├── JsonPropertyStream.h │ ├── Object.h │ ├── Output.h │ ├── README.md │ ├── Writer.h │ ├── detail │ │ └── json_assert.h │ ├── json_errors.h │ ├── json_forwards.h │ ├── json_reader.h │ ├── json_value.h │ ├── json_writer.h │ └── to_string.h │ ├── proto │ ├── README.md │ ├── org │ │ └── xrpl │ │ │ └── rpc │ │ │ └── v1 │ │ │ ├── README.md │ │ │ ├── get_ledger.proto │ │ │ ├── get_ledger_data.proto │ │ │ ├── get_ledger_diff.proto │ │ │ ├── get_ledger_entry.proto │ │ │ ├── ledger.proto │ │ │ └── xrp_ledger.proto │ └── ripple.proto │ ├── protocol │ ├── AMMCore.h │ ├── AccountID.h │ ├── AmountConversions.h │ ├── ApiVersion.h │ ├── Asset.h │ ├── Batch.h │ ├── Book.h │ ├── BuildInfo.h │ ├── ErrorCodes.h │ ├── Feature.h │ ├── FeeUnits.h │ ├── Fees.h │ ├── HashPrefix.h │ ├── IOUAmount.h │ ├── Indexes.h │ ├── InnerObjectFormats.h │ ├── Issue.h │ ├── KeyType.h │ ├── Keylet.h │ ├── KnownFormats.h │ ├── LedgerFormats.h │ ├── LedgerHeader.h │ ├── MPTAmount.h │ ├── MPTIssue.h │ ├── MultiApiJson.h │ ├── NFTSyntheticSerializer.h │ ├── NFTokenID.h │ ├── NFTokenOfferID.h │ ├── PayChan.h │ ├── Permissions.h │ ├── Protocol.h │ ├── PublicKey.h │ ├── Quality.h │ ├── QualityFunction.h │ ├── README.md │ ├── RPCErr.h │ ├── Rate.h │ ├── RippleLedgerHash.h │ ├── Rules.h │ ├── SField.h │ ├── SOTemplate.h │ ├── STAccount.h │ ├── STAmount.h │ ├── STArray.h │ ├── STBase.h │ ├── STBitString.h │ ├── STBlob.h │ ├── STCurrency.h │ ├── STExchange.h │ ├── STInteger.h │ ├── STIssue.h │ ├── STLedgerEntry.h │ ├── STNumber.h │ ├── STObject.h │ ├── STParsedJSON.h │ ├── STPathSet.h │ ├── STTx.h │ ├── STValidation.h │ ├── STVector256.h │ ├── STXChainBridge.h │ ├── SecretKey.h │ ├── Seed.h │ ├── SeqProxy.h │ ├── Serializer.h │ ├── Sign.h │ ├── SystemParameters.h │ ├── TER.h │ ├── TxFlags.h │ ├── TxFormats.h │ ├── TxMeta.h │ ├── UintTypes.h │ ├── XChainAttestations.h │ ├── XRPAmount.h │ ├── detail │ │ ├── STVar.h │ │ ├── b58_utils.h │ │ ├── features.macro │ │ ├── ledger_entries.macro │ │ ├── permissions.macro │ │ ├── secp256k1.h │ │ ├── sfields.macro │ │ ├── token_errors.h │ │ └── transactions.macro │ ├── digest.h │ ├── json_get_or_throw.h │ ├── jss.h │ ├── messages.h │ ├── nft.h │ ├── nftPageMask.h │ ├── serialize.h │ ├── st.h │ └── tokens.h │ ├── resource │ ├── Charge.h │ ├── Consumer.h │ ├── Disposition.h │ ├── Fees.h │ ├── Gossip.h │ ├── README.md │ ├── ResourceManager.h │ ├── Types.h │ └── detail │ │ ├── Entry.h │ │ ├── Import.h │ │ ├── Key.h │ │ ├── Kind.h │ │ ├── Logic.h │ │ └── Tuning.h │ └── server │ ├── Handoff.h │ ├── Port.h │ ├── Server.h │ ├── Session.h │ ├── SimpleWriter.h │ ├── WSSession.h │ ├── Writer.h │ └── detail │ ├── BaseHTTPPeer.h │ ├── BasePeer.h │ ├── BaseWSPeer.h │ ├── Door.h │ ├── JSONRPCUtil.h │ ├── LowestLayer.h │ ├── PlainHTTPPeer.h │ ├── PlainWSPeer.h │ ├── SSLHTTPPeer.h │ ├── SSLWSPeer.h │ ├── ServerImpl.h │ └── io_list.h ├── src ├── libxrpl │ ├── basics │ │ ├── Archive.cpp │ │ ├── BasicConfig.cpp │ │ ├── CountedObject.cpp │ │ ├── FileUtilities.cpp │ │ ├── Log.cpp │ │ ├── Number.cpp │ │ ├── ResolverAsio.cpp │ │ ├── StringUtilities.cpp │ │ ├── UptimeClock.cpp │ │ ├── base64.cpp │ │ ├── contract.cpp │ │ ├── make_SSLContext.cpp │ │ └── mulDiv.cpp │ ├── beast │ │ ├── clock │ │ │ └── basic_seconds_clock.cpp │ │ ├── core │ │ │ ├── CurrentThreadName.cpp │ │ │ └── SemanticVersion.cpp │ │ ├── insight │ │ │ ├── Collector.cpp │ │ │ ├── Groups.cpp │ │ │ ├── Hook.cpp │ │ │ ├── Metric.cpp │ │ │ ├── NullCollector.cpp │ │ │ └── StatsDCollector.cpp │ │ ├── net │ │ │ ├── IPAddressConversion.cpp │ │ │ ├── IPAddressV4.cpp │ │ │ ├── IPAddressV6.cpp │ │ │ └── IPEndpoint.cpp │ │ └── utility │ │ │ ├── beast_Journal.cpp │ │ │ └── beast_PropertyStream.cpp │ ├── crypto │ │ ├── RFC1751.cpp │ │ ├── csprng.cpp │ │ └── secure_erase.cpp │ ├── json │ │ ├── JsonPropertyStream.cpp │ │ ├── Object.cpp │ │ ├── Output.cpp │ │ ├── Writer.cpp │ │ ├── json_reader.cpp │ │ ├── json_value.cpp │ │ ├── json_valueiterator.cpp │ │ ├── json_writer.cpp │ │ └── to_string.cpp │ ├── protocol │ │ ├── AMMCore.cpp │ │ ├── AccountID.cpp │ │ ├── Asset.cpp │ │ ├── Book.cpp │ │ ├── BuildInfo.cpp │ │ ├── ErrorCodes.cpp │ │ ├── Feature.cpp │ │ ├── IOUAmount.cpp │ │ ├── Indexes.cpp │ │ ├── InnerObjectFormats.cpp │ │ ├── Issue.cpp │ │ ├── Keylet.cpp │ │ ├── LedgerFormats.cpp │ │ ├── LedgerHeader.cpp │ │ ├── MPTAmount.cpp │ │ ├── MPTIssue.cpp │ │ ├── NFTSyntheticSerializer.cpp │ │ ├── NFTokenID.cpp │ │ ├── NFTokenOfferID.cpp │ │ ├── Permissions.cpp │ │ ├── PublicKey.cpp │ │ ├── Quality.cpp │ │ ├── QualityFunction.cpp │ │ ├── RPCErr.cpp │ │ ├── Rate2.cpp │ │ ├── Rules.cpp │ │ ├── SField.cpp │ │ ├── SOTemplate.cpp │ │ ├── STAccount.cpp │ │ ├── STAmount.cpp │ │ ├── STArray.cpp │ │ ├── STBase.cpp │ │ ├── STBlob.cpp │ │ ├── STCurrency.cpp │ │ ├── STInteger.cpp │ │ ├── STIssue.cpp │ │ ├── STLedgerEntry.cpp │ │ ├── STNumber.cpp │ │ ├── STObject.cpp │ │ ├── STParsedJSON.cpp │ │ ├── STPathSet.cpp │ │ ├── STTx.cpp │ │ ├── STValidation.cpp │ │ ├── STVar.cpp │ │ ├── STVector256.cpp │ │ ├── STXChainBridge.cpp │ │ ├── SecretKey.cpp │ │ ├── Seed.cpp │ │ ├── Serializer.cpp │ │ ├── Sign.cpp │ │ ├── TER.cpp │ │ ├── TxFormats.cpp │ │ ├── TxMeta.cpp │ │ ├── UintTypes.cpp │ │ ├── XChainAttestations.cpp │ │ ├── digest.cpp │ │ └── tokens.cpp │ ├── resource │ │ ├── Charge.cpp │ │ ├── Consumer.cpp │ │ ├── Fees.cpp │ │ └── ResourceManager.cpp │ └── server │ │ ├── JSONRPCUtil.cpp │ │ └── Port.cpp ├── test │ ├── README.md │ ├── app │ │ ├── AMMCalc_test.cpp │ │ ├── AMMClawback_test.cpp │ │ ├── AMMExtended_test.cpp │ │ ├── AMM_test.cpp │ │ ├── AccountDelete_test.cpp │ │ ├── AccountTxPaging_test.cpp │ │ ├── AmendmentTable_test.cpp │ │ ├── Batch_test.cpp │ │ ├── Check_test.cpp │ │ ├── Clawback_test.cpp │ │ ├── Credentials_test.cpp │ │ ├── CrossingLimits_test.cpp │ │ ├── DID_test.cpp │ │ ├── DNS_test.cpp │ │ ├── Delegate_test.cpp │ │ ├── DeliverMin_test.cpp │ │ ├── DepositAuth_test.cpp │ │ ├── Discrepancy_test.cpp │ │ ├── EscrowToken_test.cpp │ │ ├── Escrow_test.cpp │ │ ├── FeeVote_test.cpp │ │ ├── FixNFTokenPageLinks_test.cpp │ │ ├── Flow_test.cpp │ │ ├── Freeze_test.cpp │ │ ├── HashRouter_test.cpp │ │ ├── LPTokenTransfer_test.cpp │ │ ├── LedgerHistory_test.cpp │ │ ├── LedgerLoad_test.cpp │ │ ├── LedgerMaster_test.cpp │ │ ├── LedgerReplay_test.cpp │ │ ├── LoadFeeTrack_test.cpp │ │ ├── MPToken_test.cpp │ │ ├── Manifest_test.cpp │ │ ├── MultiSign_test.cpp │ │ ├── NFTokenAuth_test.cpp │ │ ├── NFTokenBurn_test.cpp │ │ ├── NFTokenDir_test.cpp │ │ ├── NFToken_test.cpp │ │ ├── NetworkID_test.cpp │ │ ├── OfferStream_test.cpp │ │ ├── Offer_test.cpp │ │ ├── Oracle_test.cpp │ │ ├── OversizeMeta_test.cpp │ │ ├── Path_test.cpp │ │ ├── PayChan_test.cpp │ │ ├── PayStrand_test.cpp │ │ ├── PermissionedDEX_test.cpp │ │ ├── PermissionedDomains_test.cpp │ │ ├── PseudoTx_test.cpp │ │ ├── RCLCensorshipDetector_test.cpp │ │ ├── RCLValidations_test.cpp │ │ ├── ReducedOffer_test.cpp │ │ ├── Regression_test.cpp │ │ ├── SHAMapStore_test.cpp │ │ ├── SetAuth_test.cpp │ │ ├── SetRegularKey_test.cpp │ │ ├── SetTrust_test.cpp │ │ ├── Taker_test.cpp │ │ ├── TheoreticalQuality_test.cpp │ │ ├── Ticket_test.cpp │ │ ├── Transaction_ordering_test.cpp │ │ ├── TrustAndBalance_test.cpp │ │ ├── TxQ_test.cpp │ │ ├── ValidatorKeys_test.cpp │ │ ├── ValidatorList_test.cpp │ │ ├── ValidatorSite_test.cpp │ │ ├── Vault_test.cpp │ │ ├── XChain_test.cpp │ │ └── tx │ │ │ └── apply_test.cpp │ ├── basics │ │ ├── Buffer_test.cpp │ │ ├── DetectCrash_test.cpp │ │ ├── Expected_test.cpp │ │ ├── FeeUnits_test.cpp │ │ ├── FileUtilities_test.cpp │ │ ├── IOUAmount_test.cpp │ │ ├── IntrusiveShared_test.cpp │ │ ├── KeyCache_test.cpp │ │ ├── Number_test.cpp │ │ ├── PerfLog_test.cpp │ │ ├── RangeSet_test.cpp │ │ ├── Slice_test.cpp │ │ ├── StringUtilities_test.cpp │ │ ├── TaggedCache_test.cpp │ │ ├── XRPAmount_test.cpp │ │ ├── base58_test.cpp │ │ ├── base64_test.cpp │ │ ├── base_uint_test.cpp │ │ ├── contract_test.cpp │ │ ├── hardened_hash_test.cpp │ │ ├── join_test.cpp │ │ ├── mulDiv_test.cpp │ │ ├── scope_test.cpp │ │ └── tagged_integer_test.cpp │ ├── beast │ │ ├── IPEndpointCommon.h │ │ ├── IPEndpoint_test.cpp │ │ ├── LexicalCast_test.cpp │ │ ├── SemanticVersion_test.cpp │ │ ├── aged_associative_container_test.cpp │ │ ├── beast_CurrentThreadName_test.cpp │ │ ├── beast_Journal_test.cpp │ │ ├── beast_PropertyStream_test.cpp │ │ ├── beast_Zero_test.cpp │ │ ├── beast_abstract_clock_test.cpp │ │ ├── beast_basic_seconds_clock_test.cpp │ │ ├── beast_io_latency_probe_test.cpp │ │ └── define_print.cpp │ ├── conditions │ │ └── PreimageSha256_test.cpp │ ├── consensus │ │ ├── ByzantineFailureSim_test.cpp │ │ ├── Consensus_test.cpp │ │ ├── DistributedValidatorsSim_test.cpp │ │ ├── LedgerTiming_test.cpp │ │ ├── LedgerTrie_test.cpp │ │ ├── NegativeUNL_test.cpp │ │ ├── ScaleFreeSim_test.cpp │ │ └── Validations_test.cpp │ ├── core │ │ ├── ClosureCounter_test.cpp │ │ ├── Config_test.cpp │ │ ├── Coroutine_test.cpp │ │ ├── CryptoPRNG_test.cpp │ │ ├── JobQueue_test.cpp │ │ ├── SociDB_test.cpp │ │ └── Workers_test.cpp │ ├── csf.h │ ├── csf │ │ ├── BasicNetwork.h │ │ ├── BasicNetwork_test.cpp │ │ ├── CollectorRef.h │ │ ├── Digraph.h │ │ ├── Digraph_test.cpp │ │ ├── Histogram.h │ │ ├── Histogram_test.cpp │ │ ├── Peer.h │ │ ├── PeerGroup.h │ │ ├── Proposal.h │ │ ├── README.md │ │ ├── Scheduler.h │ │ ├── Scheduler_test.cpp │ │ ├── Sim.h │ │ ├── SimTime.h │ │ ├── TrustGraph.h │ │ ├── Tx.h │ │ ├── Validation.h │ │ ├── collectors.h │ │ ├── csf_graph.png │ │ ├── csf_overview.png │ │ ├── events.h │ │ ├── impl │ │ │ ├── Sim.cpp │ │ │ └── ledgers.cpp │ │ ├── ledgers.h │ │ ├── random.h │ │ ├── submitters.h │ │ └── timers.h │ ├── json │ │ ├── Object_test.cpp │ │ ├── Output_test.cpp │ │ ├── TestOutputSuite.h │ │ ├── Writer_test.cpp │ │ └── json_value_test.cpp │ ├── jtx.h │ ├── jtx │ │ ├── AMM.h │ │ ├── AMMTest.h │ │ ├── AbstractClient.h │ │ ├── Account.h │ │ ├── CaptureLogs.h │ │ ├── CheckMessageLogs.h │ │ ├── Env.h │ │ ├── Env_ss.h │ │ ├── Env_test.cpp │ │ ├── JSONRPCClient.h │ │ ├── JTx.h │ │ ├── ManualTimeKeeper.h │ │ ├── Oracle.h │ │ ├── PathSet.h │ │ ├── SignerUtils.h │ │ ├── TestHelpers.h │ │ ├── TestSuite.h │ │ ├── TrustedPublisherServer.h │ │ ├── WSClient.h │ │ ├── WSClient_test.cpp │ │ ├── account_txn_id.h │ │ ├── acctdelete.h │ │ ├── amount.h │ │ ├── attester.h │ │ ├── balance.h │ │ ├── basic_prop.h │ │ ├── batch.h │ │ ├── check.h │ │ ├── credentials.h │ │ ├── delegate.h │ │ ├── delivermin.h │ │ ├── deposit.h │ │ ├── did.h │ │ ├── domain.h │ │ ├── envconfig.h │ │ ├── escrow.h │ │ ├── fee.h │ │ ├── flags.h │ │ ├── impl │ │ │ ├── AMM.cpp │ │ │ ├── AMMTest.cpp │ │ │ ├── Account.cpp │ │ │ ├── Env.cpp │ │ │ ├── JSONRPCClient.cpp │ │ │ ├── Oracle.cpp │ │ │ ├── TestHelpers.cpp │ │ │ ├── WSClient.cpp │ │ │ ├── account_txn_id.cpp │ │ │ ├── acctdelete.cpp │ │ │ ├── amount.cpp │ │ │ ├── attester.cpp │ │ │ ├── balance.cpp │ │ │ ├── batch.cpp │ │ │ ├── check.cpp │ │ │ ├── creds.cpp │ │ │ ├── delegate.cpp │ │ │ ├── delivermin.cpp │ │ │ ├── deposit.cpp │ │ │ ├── dids.cpp │ │ │ ├── domain.cpp │ │ │ ├── envconfig.cpp │ │ │ ├── escrow.cpp │ │ │ ├── fee.cpp │ │ │ ├── flags.cpp │ │ │ ├── invoice_id.cpp │ │ │ ├── jtx_json.cpp │ │ │ ├── last_ledger_sequence.cpp │ │ │ ├── ledgerStateFixes.cpp │ │ │ ├── memo.cpp │ │ │ ├── mpt.cpp │ │ │ ├── multisign.cpp │ │ │ ├── offer.cpp │ │ │ ├── owners.cpp │ │ │ ├── paths.cpp │ │ │ ├── pay.cpp │ │ │ ├── permissioned_dex.cpp │ │ │ ├── permissioned_domains.cpp │ │ │ ├── quality2.cpp │ │ │ ├── rate.cpp │ │ │ ├── regkey.cpp │ │ │ ├── sendmax.cpp │ │ │ ├── seq.cpp │ │ │ ├── sig.cpp │ │ │ ├── tag.cpp │ │ │ ├── ticket.cpp │ │ │ ├── token.cpp │ │ │ ├── trust.cpp │ │ │ ├── txflags.cpp │ │ │ ├── utility.cpp │ │ │ ├── vault.cpp │ │ │ └── xchain_bridge.cpp │ │ ├── invoice_id.h │ │ ├── jtx_json.h │ │ ├── last_ledger_sequence.h │ │ ├── ledgerStateFix.h │ │ ├── memo.h │ │ ├── mpt.h │ │ ├── multisign.h │ │ ├── noop.h │ │ ├── offer.h │ │ ├── owners.h │ │ ├── paths.h │ │ ├── pay.h │ │ ├── permissioned_dex.h │ │ ├── permissioned_domains.h │ │ ├── prop.h │ │ ├── quality.h │ │ ├── rate.h │ │ ├── regkey.h │ │ ├── require.h │ │ ├── requires.h │ │ ├── rpc.h │ │ ├── sendmax.h │ │ ├── seq.h │ │ ├── sig.h │ │ ├── tag.h │ │ ├── tags.h │ │ ├── ter.h │ │ ├── ticket.h │ │ ├── token.h │ │ ├── trust.h │ │ ├── txflags.h │ │ ├── utility.h │ │ ├── vault.h │ │ └── xchain_bridge.h │ ├── ledger │ │ ├── BookDirs_test.cpp │ │ ├── Directory_test.cpp │ │ ├── Invariants_test.cpp │ │ ├── PaymentSandbox_test.cpp │ │ ├── PendingSaves_test.cpp │ │ ├── SkipList_test.cpp │ │ └── View_test.cpp │ ├── nodestore │ │ ├── Backend_test.cpp │ │ ├── Basics_test.cpp │ │ ├── Database_test.cpp │ │ ├── TestBase.h │ │ ├── Timing_test.cpp │ │ ├── import_test.cpp │ │ └── varint_test.cpp │ ├── overlay │ │ ├── ProtocolVersion_test.cpp │ │ ├── cluster_test.cpp │ │ ├── compression_test.cpp │ │ ├── handshake_test.cpp │ │ ├── reduce_relay_test.cpp │ │ ├── short_read_test.cpp │ │ ├── traffic_count_test.cpp │ │ └── tx_reduce_relay_test.cpp │ ├── peerfinder │ │ ├── Livecache_test.cpp │ │ └── PeerFinder_test.cpp │ ├── protocol │ │ ├── ApiVersion_test.cpp │ │ ├── BuildInfo_test.cpp │ │ ├── Hooks_test.cpp │ │ ├── InnerObjectFormats_test.cpp │ │ ├── Issue_test.cpp │ │ ├── Memo_test.cpp │ │ ├── MultiApiJson_test.cpp │ │ ├── PublicKey_test.cpp │ │ ├── Quality_test.cpp │ │ ├── STAccount_test.cpp │ │ ├── STAmount_test.cpp │ │ ├── STIssue_test.cpp │ │ ├── STNumber_test.cpp │ │ ├── STObject_test.cpp │ │ ├── STTx_test.cpp │ │ ├── STValidation_test.cpp │ │ ├── SecretKey_test.cpp │ │ ├── Seed_test.cpp │ │ ├── SeqProxy_test.cpp │ │ ├── Serializer_test.cpp │ │ ├── TER_test.cpp │ │ └── types_test.cpp │ ├── resource │ │ └── Logic_test.cpp │ ├── rpc │ │ ├── AMMInfo_test.cpp │ │ ├── AccountCurrencies_test.cpp │ │ ├── AccountInfo_test.cpp │ │ ├── AccountLines_test.cpp │ │ ├── AccountObjects_test.cpp │ │ ├── AccountOffers_test.cpp │ │ ├── AccountSet_test.cpp │ │ ├── AccountTx_test.cpp │ │ ├── AmendmentBlocked_test.cpp │ │ ├── BookChanges_test.cpp │ │ ├── Book_test.cpp │ │ ├── Connect_test.cpp │ │ ├── DeliveredAmount_test.cpp │ │ ├── DepositAuthorized_test.cpp │ │ ├── Feature_test.cpp │ │ ├── GRPCTestClientBase.h │ │ ├── GatewayBalances_test.cpp │ │ ├── GetAggregatePrice_test.cpp │ │ ├── GetCounts_test.cpp │ │ ├── Handler_test.cpp │ │ ├── JSONRPC_test.cpp │ │ ├── KeyGeneration_test.cpp │ │ ├── LedgerClosed_test.cpp │ │ ├── LedgerData_test.cpp │ │ ├── LedgerEntry_test.cpp │ │ ├── LedgerHeader_test.cpp │ │ ├── LedgerRPC_test.cpp │ │ ├── LedgerRequestRPC_test.cpp │ │ ├── ManifestRPC_test.cpp │ │ ├── NoRippleCheck_test.cpp │ │ ├── NoRipple_test.cpp │ │ ├── OwnerInfo_test.cpp │ │ ├── Peers_test.cpp │ │ ├── RPCCall_test.cpp │ │ ├── RPCHelpers_test.cpp │ │ ├── RPCOverload_test.cpp │ │ ├── RobustTransaction_test.cpp │ │ ├── Roles_test.cpp │ │ ├── ServerInfo_test.cpp │ │ ├── Simulate_test.cpp │ │ ├── Status_test.cpp │ │ ├── Subscribe_test.cpp │ │ ├── TransactionEntry_test.cpp │ │ ├── TransactionHistory_test.cpp │ │ ├── Transaction_test.cpp │ │ ├── ValidatorInfo_test.cpp │ │ ├── ValidatorRPC_test.cpp │ │ └── Version_test.cpp │ ├── server │ │ ├── ServerStatus_test.cpp │ │ └── Server_test.cpp │ ├── shamap │ │ ├── FetchPack_test.cpp │ │ ├── SHAMapSync_test.cpp │ │ ├── SHAMap_test.cpp │ │ └── common.h │ └── unit_test │ │ ├── FileDirGuard.h │ │ ├── SuiteJournal.h │ │ ├── multi_runner.cpp │ │ └── multi_runner.h └── xrpld │ ├── README.md │ ├── app │ ├── consensus │ │ ├── RCLCensorshipDetector.h │ │ ├── RCLConsensus.cpp │ │ ├── RCLConsensus.h │ │ ├── RCLCxLedger.h │ │ ├── RCLCxPeerPos.cpp │ │ ├── RCLCxPeerPos.h │ │ ├── RCLCxTx.h │ │ ├── RCLValidations.cpp │ │ ├── RCLValidations.h │ │ └── README.md │ ├── ledger │ │ ├── AbstractFetchPackContainer.h │ │ ├── AcceptedLedger.cpp │ │ ├── AcceptedLedger.h │ │ ├── AcceptedLedgerTx.cpp │ │ ├── AcceptedLedgerTx.h │ │ ├── AccountStateSF.cpp │ │ ├── AccountStateSF.h │ │ ├── BookListeners.cpp │ │ ├── BookListeners.h │ │ ├── BuildLedger.h │ │ ├── ConsensusTransSetSF.cpp │ │ ├── ConsensusTransSetSF.h │ │ ├── InboundLedger.h │ │ ├── InboundLedgers.h │ │ ├── InboundTransactions.h │ │ ├── InboundTransactions.uml │ │ ├── Ledger.cpp │ │ ├── Ledger.h │ │ ├── LedgerCleaner.h │ │ ├── LedgerHistory.cpp │ │ ├── LedgerHistory.h │ │ ├── LedgerHolder.h │ │ ├── LedgerMaster.h │ │ ├── LedgerReplay.h │ │ ├── LedgerReplayTask.h │ │ ├── LedgerReplayer.h │ │ ├── LedgerToJson.h │ │ ├── LocalTxs.h │ │ ├── OpenLedger.h │ │ ├── OrderBookDB.cpp │ │ ├── OrderBookDB.h │ │ ├── PendingSaves.h │ │ ├── README.md │ │ ├── TransactionMaster.h │ │ ├── TransactionStateSF.cpp │ │ ├── TransactionStateSF.h │ │ └── detail │ │ │ ├── BuildLedger.cpp │ │ │ ├── InboundLedger.cpp │ │ │ ├── InboundLedgers.cpp │ │ │ ├── InboundTransactions.cpp │ │ │ ├── LedgerCleaner.cpp │ │ │ ├── LedgerDeltaAcquire.cpp │ │ │ ├── LedgerDeltaAcquire.h │ │ │ ├── LedgerMaster.cpp │ │ │ ├── LedgerReplay.cpp │ │ │ ├── LedgerReplayMsgHandler.cpp │ │ │ ├── LedgerReplayMsgHandler.h │ │ │ ├── LedgerReplayTask.cpp │ │ │ ├── LedgerReplayer.cpp │ │ │ ├── LedgerToJson.cpp │ │ │ ├── LocalTxs.cpp │ │ │ ├── OpenLedger.cpp │ │ │ ├── SkipListAcquire.cpp │ │ │ ├── SkipListAcquire.h │ │ │ ├── TimeoutCounter.cpp │ │ │ ├── TimeoutCounter.h │ │ │ ├── TransactionAcquire.cpp │ │ │ ├── TransactionAcquire.h │ │ │ └── TransactionMaster.cpp │ ├── main │ │ ├── Application.cpp │ │ ├── Application.h │ │ ├── BasicApp.cpp │ │ ├── BasicApp.h │ │ ├── CollectorManager.cpp │ │ ├── CollectorManager.h │ │ ├── DBInit.h │ │ ├── GRPCServer.cpp │ │ ├── GRPCServer.h │ │ ├── LoadManager.cpp │ │ ├── LoadManager.h │ │ ├── Main.cpp │ │ ├── NodeIdentity.cpp │ │ ├── NodeIdentity.h │ │ ├── NodeStoreScheduler.cpp │ │ ├── NodeStoreScheduler.h │ │ └── Tuning.h │ ├── misc │ │ ├── AMMHelpers.h │ │ ├── AMMUtils.h │ │ ├── AmendmentTable.h │ │ ├── CanonicalTXSet.cpp │ │ ├── CanonicalTXSet.h │ │ ├── CredentialHelpers.cpp │ │ ├── CredentialHelpers.h │ │ ├── DelegateUtils.h │ │ ├── DeliverMax.h │ │ ├── FeeEscalation.md │ │ ├── FeeVote.h │ │ ├── FeeVoteImpl.cpp │ │ ├── HashRouter.cpp │ │ ├── HashRouter.h │ │ ├── LoadFeeTrack.h │ │ ├── Manifest.h │ │ ├── NegativeUNLVote.cpp │ │ ├── NegativeUNLVote.h │ │ ├── NetworkOPs.cpp │ │ ├── NetworkOPs.h │ │ ├── PermissionedDEXHelpers.cpp │ │ ├── PermissionedDEXHelpers.h │ │ ├── README.md │ │ ├── SHAMapStore.h │ │ ├── SHAMapStoreImp.cpp │ │ ├── SHAMapStoreImp.h │ │ ├── Transaction.h │ │ ├── TxQ.h │ │ ├── ValidatorKeys.h │ │ ├── ValidatorList.h │ │ ├── ValidatorSite.h │ │ └── detail │ │ │ ├── AMMHelpers.cpp │ │ │ ├── AMMUtils.cpp │ │ │ ├── AccountTxPaging.cpp │ │ │ ├── AccountTxPaging.h │ │ │ ├── AmendmentTable.cpp │ │ │ ├── DelegateUtils.cpp │ │ │ ├── DeliverMax.cpp │ │ │ ├── LoadFeeTrack.cpp │ │ │ ├── Manifest.cpp │ │ │ ├── Transaction.cpp │ │ │ ├── TxQ.cpp │ │ │ ├── ValidatorKeys.cpp │ │ │ ├── ValidatorList.cpp │ │ │ ├── ValidatorSite.cpp │ │ │ ├── Work.h │ │ │ ├── WorkBase.h │ │ │ ├── WorkFile.h │ │ │ ├── WorkPlain.h │ │ │ ├── WorkSSL.cpp │ │ │ └── WorkSSL.h │ ├── paths │ │ ├── AMMContext.h │ │ ├── AMMLiquidity.h │ │ ├── AMMOffer.h │ │ ├── AccountCurrencies.cpp │ │ ├── AccountCurrencies.h │ │ ├── Credit.cpp │ │ ├── Credit.h │ │ ├── Flow.cpp │ │ ├── Flow.h │ │ ├── PathRequest.cpp │ │ ├── PathRequest.h │ │ ├── PathRequests.cpp │ │ ├── PathRequests.h │ │ ├── Pathfinder.cpp │ │ ├── Pathfinder.h │ │ ├── RippleCalc.cpp │ │ ├── RippleCalc.h │ │ ├── RippleLineCache.cpp │ │ ├── RippleLineCache.h │ │ ├── TrustLine.cpp │ │ ├── TrustLine.h │ │ └── detail │ │ │ ├── AMMLiquidity.cpp │ │ │ ├── AMMOffer.cpp │ │ │ ├── AmountSpec.h │ │ │ ├── BookStep.cpp │ │ │ ├── DirectStep.cpp │ │ │ ├── FlatSets.h │ │ │ ├── FlowDebugInfo.h │ │ │ ├── PathfinderUtils.h │ │ │ ├── PaySteps.cpp │ │ │ ├── StepChecks.h │ │ │ ├── Steps.h │ │ │ ├── StrandFlow.h │ │ │ └── XRPEndpointStep.cpp │ ├── rdb │ │ ├── PeerFinder.h │ │ ├── README.md │ │ ├── RelationalDatabase.h │ │ ├── State.h │ │ ├── Vacuum.h │ │ ├── Wallet.h │ │ ├── backend │ │ │ ├── SQLiteDatabase.h │ │ │ └── detail │ │ │ │ ├── Node.cpp │ │ │ │ ├── Node.h │ │ │ │ └── SQLiteDatabase.cpp │ │ └── detail │ │ │ ├── PeerFinder.cpp │ │ │ ├── RelationalDatabase.cpp │ │ │ ├── State.cpp │ │ │ ├── Vacuum.cpp │ │ │ └── Wallet.cpp │ └── tx │ │ ├── apply.h │ │ ├── applySteps.h │ │ └── detail │ │ ├── AMMBid.cpp │ │ ├── AMMBid.h │ │ ├── AMMClawback.cpp │ │ ├── AMMClawback.h │ │ ├── AMMCreate.cpp │ │ ├── AMMCreate.h │ │ ├── AMMDelete.cpp │ │ ├── AMMDelete.h │ │ ├── AMMDeposit.cpp │ │ ├── AMMDeposit.h │ │ ├── AMMVote.cpp │ │ ├── AMMVote.h │ │ ├── AMMWithdraw.cpp │ │ ├── AMMWithdraw.h │ │ ├── ApplyContext.cpp │ │ ├── ApplyContext.h │ │ ├── Batch.cpp │ │ ├── Batch.h │ │ ├── BookTip.cpp │ │ ├── BookTip.h │ │ ├── CancelCheck.cpp │ │ ├── CancelCheck.h │ │ ├── CancelOffer.cpp │ │ ├── CancelOffer.h │ │ ├── CashCheck.cpp │ │ ├── CashCheck.h │ │ ├── Change.cpp │ │ ├── Change.h │ │ ├── Clawback.cpp │ │ ├── Clawback.h │ │ ├── CreateCheck.cpp │ │ ├── CreateCheck.h │ │ ├── CreateOffer.cpp │ │ ├── CreateOffer.h │ │ ├── CreateTicket.cpp │ │ ├── CreateTicket.h │ │ ├── Credentials.cpp │ │ ├── Credentials.h │ │ ├── DID.cpp │ │ ├── DID.h │ │ ├── DelegateSet.cpp │ │ ├── DelegateSet.h │ │ ├── DeleteAccount.cpp │ │ ├── DeleteAccount.h │ │ ├── DeleteOracle.cpp │ │ ├── DeleteOracle.h │ │ ├── DepositPreauth.cpp │ │ ├── DepositPreauth.h │ │ ├── Escrow.cpp │ │ ├── Escrow.h │ │ ├── InvariantCheck.cpp │ │ ├── InvariantCheck.h │ │ ├── LedgerStateFix.cpp │ │ ├── LedgerStateFix.h │ │ ├── MPTokenAuthorize.cpp │ │ ├── MPTokenAuthorize.h │ │ ├── MPTokenIssuanceCreate.cpp │ │ ├── MPTokenIssuanceCreate.h │ │ ├── MPTokenIssuanceDestroy.cpp │ │ ├── MPTokenIssuanceDestroy.h │ │ ├── MPTokenIssuanceSet.cpp │ │ ├── MPTokenIssuanceSet.h │ │ ├── NFTokenAcceptOffer.cpp │ │ ├── NFTokenAcceptOffer.h │ │ ├── NFTokenBurn.cpp │ │ ├── NFTokenBurn.h │ │ ├── NFTokenCancelOffer.cpp │ │ ├── NFTokenCancelOffer.h │ │ ├── NFTokenCreateOffer.cpp │ │ ├── NFTokenCreateOffer.h │ │ ├── NFTokenMint.cpp │ │ ├── NFTokenMint.h │ │ ├── NFTokenModify.cpp │ │ ├── NFTokenModify.h │ │ ├── NFTokenUtils.cpp │ │ ├── NFTokenUtils.h │ │ ├── Offer.h │ │ ├── OfferStream.cpp │ │ ├── OfferStream.h │ │ ├── PayChan.cpp │ │ ├── PayChan.h │ │ ├── Payment.cpp │ │ ├── Payment.h │ │ ├── PermissionedDomainDelete.cpp │ │ ├── PermissionedDomainDelete.h │ │ ├── PermissionedDomainSet.cpp │ │ ├── PermissionedDomainSet.h │ │ ├── SetAccount.cpp │ │ ├── SetAccount.h │ │ ├── SetOracle.cpp │ │ ├── SetOracle.h │ │ ├── SetRegularKey.cpp │ │ ├── SetRegularKey.h │ │ ├── SetSignerList.cpp │ │ ├── SetSignerList.h │ │ ├── SetTrust.cpp │ │ ├── SetTrust.h │ │ ├── SignerEntries.cpp │ │ ├── SignerEntries.h │ │ ├── Taker.cpp │ │ ├── Taker.h │ │ ├── Transactor.cpp │ │ ├── Transactor.h │ │ ├── VaultClawback.cpp │ │ ├── VaultClawback.h │ │ ├── VaultCreate.cpp │ │ ├── VaultCreate.h │ │ ├── VaultDelete.cpp │ │ ├── VaultDelete.h │ │ ├── VaultDeposit.cpp │ │ ├── VaultDeposit.h │ │ ├── VaultSet.cpp │ │ ├── VaultSet.h │ │ ├── VaultWithdraw.cpp │ │ ├── VaultWithdraw.h │ │ ├── XChainBridge.cpp │ │ ├── XChainBridge.h │ │ ├── apply.cpp │ │ └── applySteps.cpp │ ├── conditions │ ├── Condition.h │ ├── Fulfillment.h │ └── detail │ │ ├── Condition.cpp │ │ ├── Fulfillment.cpp │ │ ├── PreimageSha256.h │ │ ├── error.cpp │ │ ├── error.h │ │ └── utils.h │ ├── consensus │ ├── Consensus.cpp │ ├── Consensus.h │ ├── ConsensusParms.h │ ├── ConsensusProposal.h │ ├── ConsensusTypes.h │ ├── DisputedTx.h │ ├── LedgerTiming.h │ ├── LedgerTrie.h │ ├── README.md │ └── Validations.h │ ├── core │ ├── ClosureCounter.h │ ├── Config.h │ ├── ConfigSections.h │ ├── Coro.ipp │ ├── DatabaseCon.h │ ├── Job.h │ ├── JobQueue.h │ ├── JobTypeData.h │ ├── JobTypeInfo.h │ ├── JobTypes.h │ ├── LoadEvent.h │ ├── LoadMonitor.h │ ├── SociDB.h │ ├── TimeKeeper.h │ └── detail │ │ ├── Config.cpp │ │ ├── DatabaseCon.cpp │ │ ├── Job.cpp │ │ ├── JobQueue.cpp │ │ ├── LoadEvent.cpp │ │ ├── LoadMonitor.cpp │ │ ├── SociDB.cpp │ │ ├── Workers.cpp │ │ ├── Workers.h │ │ └── semaphore.h │ ├── ledger │ ├── ApplyView.h │ ├── ApplyViewImpl.h │ ├── BookDirs.h │ ├── CachedSLEs.h │ ├── CachedView.h │ ├── Dir.h │ ├── OpenView.h │ ├── PaymentSandbox.h │ ├── RawView.h │ ├── ReadView.h │ ├── Sandbox.h │ ├── View.h │ └── detail │ │ ├── ApplyStateTable.cpp │ │ ├── ApplyStateTable.h │ │ ├── ApplyView.cpp │ │ ├── ApplyViewBase.cpp │ │ ├── ApplyViewBase.h │ │ ├── ApplyViewImpl.cpp │ │ ├── BookDirs.cpp │ │ ├── CachedView.cpp │ │ ├── Dir.cpp │ │ ├── OpenView.cpp │ │ ├── PaymentSandbox.cpp │ │ ├── RawStateTable.cpp │ │ ├── RawStateTable.h │ │ ├── ReadView.cpp │ │ ├── ReadViewFwdRange.h │ │ ├── ReadViewFwdRange.ipp │ │ └── View.cpp │ ├── net │ ├── AutoSocket.h │ ├── HTTPClient.h │ ├── HTTPClientSSLContext.h │ ├── InfoSub.h │ ├── RPCCall.h │ ├── RPCSub.h │ ├── RegisterSSLCerts.h │ ├── detail │ │ ├── HTTPClient.cpp │ │ ├── InfoSub.cpp │ │ ├── RPCCall.cpp │ │ ├── RPCSub.cpp │ │ └── RegisterSSLCerts.cpp │ └── images │ │ ├── interrupt_sequence.png │ │ └── states.png │ ├── nodestore │ ├── Backend.h │ ├── Database.h │ ├── DatabaseRotating.h │ ├── DummyScheduler.h │ ├── Factory.h │ ├── Manager.h │ ├── NodeObject.h │ ├── README.md │ ├── Scheduler.h │ ├── Task.h │ ├── Types.h │ ├── backend │ │ ├── MemoryFactory.cpp │ │ ├── NuDBFactory.cpp │ │ ├── NullFactory.cpp │ │ └── RocksDBFactory.cpp │ └── detail │ │ ├── BatchWriter.cpp │ │ ├── BatchWriter.h │ │ ├── Database.cpp │ │ ├── DatabaseNodeImp.cpp │ │ ├── DatabaseNodeImp.h │ │ ├── DatabaseRotatingImp.cpp │ │ ├── DatabaseRotatingImp.h │ │ ├── DecodedBlob.cpp │ │ ├── DecodedBlob.h │ │ ├── DummyScheduler.cpp │ │ ├── EncodedBlob.h │ │ ├── ManagerImp.cpp │ │ ├── ManagerImp.h │ │ ├── NodeObject.cpp │ │ ├── codec.h │ │ └── varint.h │ ├── overlay │ ├── Cluster.h │ ├── ClusterNode.h │ ├── Compression.h │ ├── Message.h │ ├── Overlay.h │ ├── Peer.h │ ├── PeerReservationTable.h │ ├── PeerSet.h │ ├── README.md │ ├── ReduceRelayCommon.h │ ├── Slot.h │ ├── Squelch.h │ ├── detail │ │ ├── Cluster.cpp │ │ ├── ConnectAttempt.cpp │ │ ├── ConnectAttempt.h │ │ ├── Handshake.cpp │ │ ├── Handshake.h │ │ ├── Message.cpp │ │ ├── OverlayImpl.cpp │ │ ├── OverlayImpl.h │ │ ├── PeerImp.cpp │ │ ├── PeerImp.h │ │ ├── PeerReservationTable.cpp │ │ ├── PeerSet.cpp │ │ ├── ProtocolMessage.h │ │ ├── ProtocolVersion.cpp │ │ ├── ProtocolVersion.h │ │ ├── TrafficCount.cpp │ │ ├── TrafficCount.h │ │ ├── Tuning.h │ │ ├── TxMetrics.cpp │ │ ├── TxMetrics.h │ │ └── ZeroCopyStream.h │ ├── make_Overlay.h │ └── predicates.h │ ├── peerfinder │ ├── PeerfinderManager.h │ ├── README.md │ ├── Slot.h │ ├── detail │ │ ├── Bootcache.cpp │ │ ├── Bootcache.h │ │ ├── Checker.h │ │ ├── Counts.h │ │ ├── Endpoint.cpp │ │ ├── Fixed.h │ │ ├── Handouts.h │ │ ├── Livecache.h │ │ ├── Logic.h │ │ ├── PeerfinderConfig.cpp │ │ ├── PeerfinderManager.cpp │ │ ├── SlotImp.cpp │ │ ├── SlotImp.h │ │ ├── Source.h │ │ ├── SourceStrings.cpp │ │ ├── SourceStrings.h │ │ ├── Store.h │ │ ├── StoreSqdb.h │ │ ├── Tuning.h │ │ └── iosformat.h │ └── make_Manager.h │ ├── perflog │ ├── PerfLog.h │ └── detail │ │ ├── PerfLogImp.cpp │ │ └── PerfLogImp.h │ ├── rpc │ ├── BookChanges.h │ ├── CTID.h │ ├── Context.h │ ├── DeliveredAmount.h │ ├── GRPCHandlers.h │ ├── MPTokenIssuanceID.h │ ├── Output.h │ ├── README.md │ ├── RPCHandler.h │ ├── Request.h │ ├── Role.h │ ├── ServerHandler.h │ ├── Status.h │ ├── detail │ │ ├── DeliveredAmount.cpp │ │ ├── Handler.cpp │ │ ├── Handler.h │ │ ├── LegacyPathFind.cpp │ │ ├── LegacyPathFind.h │ │ ├── MPTokenIssuanceID.cpp │ │ ├── RPCHandler.cpp │ │ ├── RPCHelpers.cpp │ │ ├── RPCHelpers.h │ │ ├── Role.cpp │ │ ├── ServerHandler.cpp │ │ ├── Status.cpp │ │ ├── TransactionSign.cpp │ │ ├── TransactionSign.h │ │ ├── Tuning.h │ │ └── WSInfoSub.h │ ├── handlers │ │ ├── AMMInfo.cpp │ │ ├── AccountChannels.cpp │ │ ├── AccountCurrenciesHandler.cpp │ │ ├── AccountInfo.cpp │ │ ├── AccountLines.cpp │ │ ├── AccountObjects.cpp │ │ ├── AccountOffers.cpp │ │ ├── AccountTx.cpp │ │ ├── BlackList.cpp │ │ ├── BookOffers.cpp │ │ ├── CanDelete.cpp │ │ ├── Connect.cpp │ │ ├── ConsensusInfo.cpp │ │ ├── DepositAuthorized.cpp │ │ ├── DoManifest.cpp │ │ ├── Feature1.cpp │ │ ├── Fee1.cpp │ │ ├── FetchInfo.cpp │ │ ├── GatewayBalances.cpp │ │ ├── GetAggregatePrice.cpp │ │ ├── GetCounts.cpp │ │ ├── GetCounts.h │ │ ├── Handlers.h │ │ ├── LedgerAccept.cpp │ │ ├── LedgerCleanerHandler.cpp │ │ ├── LedgerClosed.cpp │ │ ├── LedgerCurrent.cpp │ │ ├── LedgerData.cpp │ │ ├── LedgerDiff.cpp │ │ ├── LedgerEntry.cpp │ │ ├── LedgerHandler.cpp │ │ ├── LedgerHandler.h │ │ ├── LedgerHeader.cpp │ │ ├── LedgerRequest.cpp │ │ ├── LogLevel.cpp │ │ ├── LogRotate.cpp │ │ ├── NFTOffers.cpp │ │ ├── NoRippleCheck.cpp │ │ ├── OwnerInfo.cpp │ │ ├── PathFind.cpp │ │ ├── PayChanClaim.cpp │ │ ├── Peers.cpp │ │ ├── Ping.cpp │ │ ├── Print.cpp │ │ ├── Random.cpp │ │ ├── Reservations.cpp │ │ ├── RipplePathFind.cpp │ │ ├── ServerInfo.cpp │ │ ├── ServerState.cpp │ │ ├── SignFor.cpp │ │ ├── SignHandler.cpp │ │ ├── Simulate.cpp │ │ ├── Stop.cpp │ │ ├── Submit.cpp │ │ ├── SubmitMultiSigned.cpp │ │ ├── Subscribe.cpp │ │ ├── TransactionEntry.cpp │ │ ├── Tx.cpp │ │ ├── TxHistory.cpp │ │ ├── TxReduceRelay.cpp │ │ ├── UnlList.cpp │ │ ├── Unsubscribe.cpp │ │ ├── ValidationCreate.cpp │ │ ├── ValidatorInfo.cpp │ │ ├── ValidatorListSites.cpp │ │ ├── Validators.cpp │ │ ├── VaultInfo.cpp │ │ ├── Version.h │ │ ├── WalletPropose.cpp │ │ └── WalletPropose.h │ └── json_body.h │ ├── shamap │ ├── Family.h │ ├── FullBelowCache.h │ ├── NodeFamily.h │ ├── README.md │ ├── SHAMap.h │ ├── SHAMapAccountStateLeafNode.h │ ├── SHAMapAddNode.h │ ├── SHAMapInnerNode.h │ ├── SHAMapItem.h │ ├── SHAMapLeafNode.h │ ├── SHAMapMissingNode.h │ ├── SHAMapNodeID.h │ ├── SHAMapSyncFilter.h │ ├── SHAMapTreeNode.h │ ├── SHAMapTxLeafNode.h │ ├── SHAMapTxPlusMetaLeafNode.h │ ├── TreeNodeCache.h │ └── detail │ │ ├── NodeFamily.cpp │ │ ├── SHAMap.cpp │ │ ├── SHAMapDelta.cpp │ │ ├── SHAMapInnerNode.cpp │ │ ├── SHAMapLeafNode.cpp │ │ ├── SHAMapNodeID.cpp │ │ ├── SHAMapSync.cpp │ │ ├── SHAMapTreeNode.cpp │ │ ├── TaggedPointer.h │ │ └── TaggedPointer.ipp │ └── unity │ └── rocksdb.h └── tests ├── README.md └── conan ├── CMakeLists.txt ├── conanfile.py └── src └── example.cpp /.codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | require_ci_to_pass: true 3 | 4 | comment: 5 | behavior: default 6 | layout: reach,diff,flags,tree,reach 7 | show_carryforward_flags: false 8 | 9 | coverage: 10 | range: "70..85" 11 | precision: 1 12 | round: nearest 13 | status: 14 | project: 15 | default: 16 | target: 75% 17 | threshold: 2% 18 | patch: 19 | default: 20 | target: auto 21 | threshold: 2% 22 | changes: false 23 | 24 | github_checks: 25 | annotations: true 26 | 27 | parsers: 28 | cobertura: 29 | partials_as_hits: true 30 | handle_missing_conditions : true 31 | 32 | slack_app: false 33 | 34 | ignore: 35 | - "src/test/" 36 | - "include/xrpl/beast/test/" 37 | - "include/xrpl/beast/unit_test/" 38 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # This feature requires Git >= 2.24 2 | # To use it by default in git blame: 3 | # git config blame.ignoreRevsFile .git-blame-ignore-revs 4 | 50760c693510894ca368e90369b0cc2dabfd07f3 5 | e2384885f5f630c8f0ffe4bf21a169b433a16858 6 | 241b9ddde9e11beb7480600fd5ed90e1ef109b21 7 | 760f16f56835663d9286bd29294d074de26a7ba6 8 | 0eebe6a5f4246fced516d52b83ec4e7f47373edd 9 | 2189cc950c0cebb89e4e2fa3b2d8817205bf7cef 10 | b9d007813378ad0ff45660dc07285b823c7e9855 11 | fe9a5365b8a52d4acc42eb27369247e6f238a4f9 12 | 9a93577314e6a8d4b4a8368cc9d2b15a5d8303e8 13 | 552377c76f55b403a1c876df873a23d780fcc81c 14 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behaviour, in case users don't have core.autocrlf set. 2 | #* text=auto 3 | 4 | # These annoying files 5 | rippled.1 binary 6 | LICENSE binary 7 | 8 | # Visual Studio 9 | *.sln text eol=crlf 10 | *.vcproj text eol=crlf 11 | *.vcxproj text eol=crlf 12 | *.props text eol=crlf 13 | *.filters text eol=crlf 14 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Allow anyone to review any change by default. 2 | * 3 | 4 | # Require the rpc-reviewers team to review changes to the rpc code. 5 | include/xrpl/protocol/ @xrplf/rpc-reviewers 6 | src/libxrpl/protocol/ @xrplf/rpc-reviewers 7 | src/xrpld/rpc/ @xrplf/rpc-reviewers 8 | src/xrpld/app/misc/ @xrplf/rpc-reviewers 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Create a report to help us improve rippled 4 | title: "[Title with short description] (Version: [rippled version])" 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | ## Issue Description 12 | 13 | 14 | ## Steps to Reproduce 15 | 16 | 17 | ## Expected Result 18 | 19 | 20 | ## Actual Result 21 | 22 | 23 | ## Environment 24 | 25 | 26 | 27 | 28 | ## Supporting Files 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: XRP Ledger Documentation 4 | url: https://xrpl.org/ 5 | about: All things about XRPL 6 | - name: Security bug bounty program 7 | url: https://ripple.com/bug-bounty/ 8 | about: Please report security-relevant bugs in our software here. 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Suggest a new feature for the rippled project 4 | title: "[Title with short description] (Version: [rippled version])" 5 | labels: Feature Request 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | ## Summary 12 | 13 | 14 | ## Motivation 15 | 16 | 17 | ## Solution 18 | 19 | 20 | ## Paths Not Taken 21 | 22 | -------------------------------------------------------------------------------- /.github/actions/build/action.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | inputs: 3 | generator: 4 | default: null 5 | configuration: 6 | required: true 7 | cmake-args: 8 | default: null 9 | cmake-target: 10 | default: all 11 | # An implicit input is the environment variable `build_dir`. 12 | runs: 13 | using: composite 14 | steps: 15 | - name: configure 16 | shell: bash 17 | run: | 18 | cd ${build_dir} 19 | cmake \ 20 | ${{ inputs.generator && format('-G "{0}"', inputs.generator) || '' }} \ 21 | -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \ 22 | -DCMAKE_BUILD_TYPE=${{ inputs.configuration }} \ 23 | -Dtests=TRUE \ 24 | -Dxrpld=TRUE \ 25 | ${{ inputs.cmake-args }} \ 26 | .. 27 | - name: build 28 | shell: bash 29 | run: | 30 | cmake \ 31 | --build ${build_dir} \ 32 | --config ${{ inputs.configuration }} \ 33 | --parallel ${NUM_PROCESSORS:-$(nproc)} \ 34 | --target ${{ inputs.cmake-target }} 35 | -------------------------------------------------------------------------------- /.github/workflows/doxygen.yml: -------------------------------------------------------------------------------- 1 | name: Build and publish Doxygen documentation 2 | # To test this workflow, push your changes to your fork's `develop` branch. 3 | on: 4 | push: 5 | branches: 6 | - develop 7 | - doxygen 8 | concurrency: 9 | group: ${{ github.workflow }}-${{ github.ref }} 10 | cancel-in-progress: true 11 | 12 | jobs: 13 | documentation: 14 | runs-on: ubuntu-latest 15 | permissions: 16 | contents: write 17 | container: ghcr.io/xrplf/rippled-build-ubuntu:aaf5e3e 18 | steps: 19 | - name: checkout 20 | uses: actions/checkout@v4 21 | - name: check environment 22 | run: | 23 | echo ${PATH} | tr ':' '\n' 24 | cmake --version 25 | doxygen --version 26 | env | sort 27 | - name: build 28 | run: | 29 | mkdir build 30 | cd build 31 | cmake -Donly_docs=TRUE .. 32 | cmake --build . --target docs --parallel $(nproc) 33 | - name: publish 34 | uses: peaceiris/actions-gh-pages@v3 35 | with: 36 | github_token: ${{ secrets.GITHUB_TOKEN }} 37 | publish_dir: build/docs/html 38 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # .pre-commit-config.yaml 2 | repos: 3 | - repo: https://github.com/pre-commit/mirrors-clang-format 4 | rev: v18.1.3 5 | hooks: 6 | - id: clang-format 7 | -------------------------------------------------------------------------------- /Builds/levelization/results/loops.txt: -------------------------------------------------------------------------------- 1 | Loop: test.jtx test.toplevel 2 | test.toplevel > test.jtx 3 | 4 | Loop: test.jtx test.unit_test 5 | test.unit_test == test.jtx 6 | 7 | Loop: xrpld.app xrpld.core 8 | xrpld.app > xrpld.core 9 | 10 | Loop: xrpld.app xrpld.ledger 11 | xrpld.app > xrpld.ledger 12 | 13 | Loop: xrpld.app xrpld.net 14 | xrpld.app > xrpld.net 15 | 16 | Loop: xrpld.app xrpld.overlay 17 | xrpld.overlay > xrpld.app 18 | 19 | Loop: xrpld.app xrpld.peerfinder 20 | xrpld.peerfinder ~= xrpld.app 21 | 22 | Loop: xrpld.app xrpld.rpc 23 | xrpld.rpc > xrpld.app 24 | 25 | Loop: xrpld.app xrpld.shamap 26 | xrpld.app > xrpld.shamap 27 | 28 | Loop: xrpld.core xrpld.net 29 | xrpld.net > xrpld.core 30 | 31 | Loop: xrpld.core xrpld.perflog 32 | xrpld.perflog == xrpld.core 33 | 34 | Loop: xrpld.net xrpld.rpc 35 | xrpld.rpc ~= xrpld.net 36 | 37 | Loop: xrpld.overlay xrpld.rpc 38 | xrpld.rpc ~= xrpld.overlay 39 | 40 | Loop: xrpld.perflog xrpld.rpc 41 | xrpld.rpc ~= xrpld.perflog 42 | 43 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2011, Arthur Britto, David Schwartz, Jed McCaleb, Vinnie Falco, Bob Way, Eric Lombrozo, Nikolaos D. Bougalis, Howard Hinnant. 4 | Copyright (c) 2012-2020, the XRP Ledger developers. 5 | 6 | Permission to use, copy, modify, and distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | 18 | -------------------------------------------------------------------------------- /bin/email_hash.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/node 2 | // 3 | // Returns a Gravatar style hash as per: http://en.gravatar.com/site/implement/hash/ 4 | // 5 | 6 | if (3 != process.argv.length) { 7 | process.stderr.write("Usage: " + process.argv[1] + " email_address\n\nReturns gravatar style hash.\n"); 8 | process.exit(1); 9 | 10 | } else { 11 | var md5 = require('crypto').createHash('md5'); 12 | 13 | md5.update(process.argv[2].trim().toLowerCase()); 14 | 15 | process.stdout.write(md5.digest('hex') + "\n"); 16 | } 17 | 18 | // vim:sw=2:sts=2:ts=8:et 19 | -------------------------------------------------------------------------------- /bin/flash_policy.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/node 2 | // 3 | // This program allows IE 9 ripple-clients to make websocket connections to 4 | // rippled using flash. As IE 9 does not have websocket support, this required 5 | // if you wish to support IE 9 ripple-clients. 6 | // 7 | // http://www.lightsphere.com/dev/articles/flash_socket_policy.html 8 | // 9 | // For better security, be sure to set the Port below to the port of your 10 | // [websocket_public_port]. 11 | // 12 | 13 | var net = require("net"), 14 | port = "*", 15 | domains = ["*:"+port]; // Domain:Port 16 | 17 | net.createServer( 18 | function(socket) { 19 | socket.write("\n"); 20 | socket.write("\n"); 21 | socket.write("\n"); 22 | domains.forEach( 23 | function(domain) { 24 | var parts = domain.split(':'); 25 | socket.write("\t\n"); 26 | } 27 | ); 28 | socket.write("\n"); 29 | socket.end(); 30 | } 31 | ).listen(843); 32 | -------------------------------------------------------------------------------- /bin/git/update-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $# -ne 3 || "$1" == "--help" || "$1" = "-h" ]] 4 | then 5 | name=$( basename $0 ) 6 | cat <<- USAGE 7 | Usage: $name workbranch base/branch version 8 | 9 | * workbranch will be created locally from base/branch. If it exists, 10 | it will be reused, so make sure you don't overwrite any work. 11 | * base/branch may be specified as user:branch to allow easy copying 12 | from Github PRs. 13 | USAGE 14 | exit 0 15 | fi 16 | 17 | work="$1" 18 | shift 19 | 20 | base=$( echo "$1" | sed "s/:/\//" ) 21 | shift 22 | 23 | version=$1 24 | shift 25 | 26 | set -e 27 | 28 | git fetch upstreams 29 | 30 | git checkout -B "${work}" --no-track "${base}" 31 | 32 | push=$( git rev-parse --abbrev-ref --symbolic-full-name '@{push}' \ 33 | 2>/dev/null ) || true 34 | if [[ "${push}" != "" ]] 35 | then 36 | echo "Warning: ${push} may already exist." 37 | fi 38 | 39 | build=$( find -name BuildInfo.cpp ) 40 | sed 's/\(^.*versionString =\).*$/\1 "'${version}'"/' ${build} > version.cpp && \ 41 | diff "${build}" version.cpp && exit 1 || \ 42 | mv -vi version.cpp ${build} 43 | 44 | git diff 45 | 46 | git add ${build} 47 | 48 | git commit -S -m "Set version to ${version}" 49 | 50 | git log --oneline --first-parent ${base}^.. 51 | 52 | cat << PUSH 53 | 54 | ------------------------------------------------------------------- 55 | This script will not push. Verify everything is correct, then push 56 | to your repo, and create a PR as described in CONTRIBUTING.md. 57 | ------------------------------------------------------------------- 58 | PUSH 59 | -------------------------------------------------------------------------------- /bin/hexify.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/node 2 | // 3 | // Returns hex of lowercasing a string. 4 | // 5 | 6 | var stringToHex = function (s) { 7 | return Array.prototype.map.call(s, function (c) { 8 | var b = c.charCodeAt(0); 9 | 10 | return b < 16 ? "0" + b.toString(16) : b.toString(16); 11 | }).join(""); 12 | }; 13 | 14 | if (3 != process.argv.length) { 15 | process.stderr.write("Usage: " + process.argv[1] + " string\n\nReturns hex of lowercasing string.\n"); 16 | process.exit(1); 17 | 18 | } else { 19 | 20 | process.stdout.write(stringToHex(process.argv[2].toLowerCase()) + "\n"); 21 | } 22 | 23 | // vim:sw=2:sts=2:ts=8:et 24 | -------------------------------------------------------------------------------- /bin/jsonrpc_request.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/node 2 | // 3 | // This is a tool to issue JSON-RPC requests from the command line. 4 | // 5 | // This can be used to test a JSON-RPC server. 6 | // 7 | // Requires: npm simple-jsonrpc 8 | // 9 | 10 | var jsonrpc = require('simple-jsonrpc'); 11 | 12 | var program = process.argv[1]; 13 | 14 | if (5 !== process.argv.length) { 15 | console.log("Usage: %s ", program); 16 | } 17 | else { 18 | var url = process.argv[2]; 19 | var method = process.argv[3]; 20 | var json_raw = process.argv[4]; 21 | var json; 22 | 23 | try { 24 | json = JSON.parse(json_raw); 25 | } 26 | catch (e) { 27 | console.log("JSON parse error: %s", e.message); 28 | throw e; 29 | } 30 | 31 | var client = jsonrpc.client(url); 32 | 33 | client.call(method, json, 34 | function (result) { 35 | console.log(JSON.stringify(result, undefined, 2)); 36 | }, 37 | function (error) { 38 | console.log(JSON.stringify(error, undefined, 2)); 39 | }); 40 | } 41 | 42 | // vim:sw=2:sts=2:ts=8:et 43 | -------------------------------------------------------------------------------- /bin/sh/install-vcpkg.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -exu 3 | 4 | : ${TRAVIS_BUILD_DIR:=""} 5 | : ${VCPKG_DIR:=".vcpkg"} 6 | export VCPKG_ROOT=${VCPKG_DIR} 7 | : ${VCPKG_DEFAULT_TRIPLET:="x64-windows-static"} 8 | 9 | export VCPKG_DEFAULT_TRIPLET 10 | 11 | EXE="vcpkg" 12 | if [[ -z ${COMSPEC:-} ]]; then 13 | EXE="${EXE}.exe" 14 | fi 15 | 16 | if [[ -d "${VCPKG_DIR}" && -x "${VCPKG_DIR}/${EXE}" && -d "${VCPKG_DIR}/installed" ]] ; then 17 | echo "Using cached vcpkg at ${VCPKG_DIR}" 18 | ${VCPKG_DIR}/${EXE} list 19 | else 20 | if [[ -d "${VCPKG_DIR}" ]] ; then 21 | rm -rf "${VCPKG_DIR}" 22 | fi 23 | git clone --branch 2021.04.30 https://github.com/Microsoft/vcpkg.git ${VCPKG_DIR} 24 | pushd ${VCPKG_DIR} 25 | BSARGS=() 26 | if [[ "$(uname)" == "Darwin" ]] ; then 27 | BSARGS+=(--allowAppleClang) 28 | fi 29 | if [[ -z ${COMSPEC:-} ]]; then 30 | chmod +x ./bootstrap-vcpkg.sh 31 | time ./bootstrap-vcpkg.sh "${BSARGS[@]}" 32 | else 33 | time ./bootstrap-vcpkg.bat 34 | fi 35 | popd 36 | fi 37 | 38 | # TODO: bring boost in this way as well ? 39 | # NOTE: can pin specific ports to a commit/version like this: 40 | # git checkout ports/boost 41 | if [ $# -eq 0 ]; then 42 | echo "No extra packages specified..." 43 | PKGS=() 44 | else 45 | PKGS=( "$@" ) 46 | fi 47 | for LIB in "${PKGS[@]}"; do 48 | time ${VCPKG_DIR}/${EXE} --clean-after-build install ${LIB} 49 | done 50 | 51 | 52 | -------------------------------------------------------------------------------- /cmake/CMakeFuncs.cmake: -------------------------------------------------------------------------------- 1 | macro(group_sources_in source_dir curdir) 2 | file(GLOB children RELATIVE ${source_dir}/${curdir} 3 | ${source_dir}/${curdir}/*) 4 | foreach (child ${children}) 5 | if (IS_DIRECTORY ${source_dir}/${curdir}/${child}) 6 | group_sources_in(${source_dir} ${curdir}/${child}) 7 | else() 8 | string(REPLACE "/" "\\" groupname ${curdir}) 9 | source_group(${groupname} FILES 10 | ${source_dir}/${curdir}/${child}) 11 | endif() 12 | endforeach() 13 | endmacro() 14 | 15 | macro(group_sources curdir) 16 | group_sources_in(${PROJECT_SOURCE_DIR} ${curdir}) 17 | endmacro() 18 | 19 | macro (exclude_from_default target_) 20 | set_target_properties (${target_} PROPERTIES EXCLUDE_FROM_ALL ON) 21 | set_target_properties (${target_} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON) 22 | endmacro () 23 | 24 | macro (exclude_if_included target_) 25 | get_directory_property(has_parent PARENT_DIRECTORY) 26 | if (has_parent) 27 | exclude_from_default (${target_}) 28 | endif () 29 | endmacro () 30 | 31 | find_package(Git) 32 | 33 | function (git_branch branch_val) 34 | if (NOT GIT_FOUND) 35 | return () 36 | endif () 37 | set (_branch "") 38 | execute_process (COMMAND ${GIT_EXECUTABLE} "rev-parse" "--abbrev-ref" "HEAD" 39 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 40 | RESULT_VARIABLE _git_exit_code 41 | OUTPUT_VARIABLE _temp_branch 42 | OUTPUT_STRIP_TRAILING_WHITESPACE 43 | ERROR_QUIET) 44 | if (_git_exit_code EQUAL 0) 45 | set (_branch ${_temp_branch}) 46 | endif () 47 | set (${branch_val} "${_branch}" PARENT_SCOPE) 48 | endfunction () 49 | -------------------------------------------------------------------------------- /cmake/RippledCov.cmake: -------------------------------------------------------------------------------- 1 | #[===================================================================[ 2 | coverage report target 3 | #]===================================================================] 4 | 5 | if(NOT coverage) 6 | message(FATAL_ERROR "Code coverage not enabled! Aborting ...") 7 | endif() 8 | 9 | if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") 10 | message(WARNING "Code coverage on Windows is not supported, ignoring 'coverage' flag") 11 | return() 12 | endif() 13 | 14 | include(CodeCoverage) 15 | 16 | # The instructions for these commands come from the `CodeCoverage` module, 17 | # which was copied from https://github.com/bilke/cmake-modules, commit fb7d2a3, 18 | # then locally changed (see CHANGES: section in `CodeCoverage.cmake`) 19 | 20 | set(GCOVR_ADDITIONAL_ARGS ${coverage_extra_args}) 21 | if(NOT GCOVR_ADDITIONAL_ARGS STREQUAL "") 22 | separate_arguments(GCOVR_ADDITIONAL_ARGS) 23 | endif() 24 | 25 | list(APPEND GCOVR_ADDITIONAL_ARGS 26 | --exclude-throw-branches 27 | --exclude-noncode-lines 28 | --exclude-unreachable-branches -s 29 | -j ${coverage_test_parallelism}) 30 | 31 | setup_target_for_coverage_gcovr( 32 | NAME coverage 33 | FORMAT ${coverage_format} 34 | EXECUTABLE rippled 35 | EXECUTABLE_ARGS --unittest$<$:=${coverage_test}> --unittest-jobs ${coverage_test_parallelism} --quiet --unittest-log 36 | EXCLUDE "src/test" "include/xrpl/beast/test" "include/xrpl/beast/unit_test" "${CMAKE_BINARY_DIR}/pb-xrpl.libpb" 37 | DEPENDENCIES rippled 38 | ) 39 | -------------------------------------------------------------------------------- /cmake/RippledValidatorKeys.cmake: -------------------------------------------------------------------------------- 1 | option (validator_keys "Enables building of validator-keys-tool as a separate target (imported via FetchContent)" OFF) 2 | 3 | if (validator_keys) 4 | git_branch (current_branch) 5 | # default to tracking VK master branch unless we are on release 6 | if (NOT (current_branch STREQUAL "release")) 7 | set (current_branch "master") 8 | endif () 9 | message (STATUS "tracking ValidatorKeys branch: ${current_branch}") 10 | 11 | FetchContent_Declare ( 12 | validator_keys_src 13 | GIT_REPOSITORY https://github.com/ripple/validator-keys-tool.git 14 | GIT_TAG "${current_branch}" 15 | ) 16 | FetchContent_GetProperties (validator_keys_src) 17 | if (NOT validator_keys_src_POPULATED) 18 | message (STATUS "Pausing to download ValidatorKeys...") 19 | FetchContent_Populate (validator_keys_src) 20 | endif () 21 | add_subdirectory (${validator_keys_src_SOURCE_DIR} ${CMAKE_BINARY_DIR}/validator-keys) 22 | endif () 23 | -------------------------------------------------------------------------------- /cmake/RippledVersion.cmake: -------------------------------------------------------------------------------- 1 | #[===================================================================[ 2 | read version from source 3 | #]===================================================================] 4 | 5 | file(STRINGS src/libxrpl/protocol/BuildInfo.cpp BUILD_INFO) 6 | foreach(line_ ${BUILD_INFO}) 7 | if(line_ MATCHES "versionString[ ]*=[ ]*\"(.+)\"") 8 | set(rippled_version ${CMAKE_MATCH_1}) 9 | endif() 10 | endforeach() 11 | if(rippled_version) 12 | message(STATUS "rippled version: ${rippled_version}") 13 | else() 14 | message(FATAL_ERROR "unable to determine rippled version") 15 | endif() 16 | -------------------------------------------------------------------------------- /cmake/add_module.cmake: -------------------------------------------------------------------------------- 1 | include(isolate_headers) 2 | 3 | # Create an OBJECT library target named 4 | # 5 | # ${PROJECT_NAME}.lib${parent}.${name} 6 | # 7 | # with sources in src/lib${parent}/${name} 8 | # and headers in include/${parent}/${name} 9 | # that cannot include headers from other directories in include/ 10 | # unless they come through linked libraries. 11 | # 12 | # add_module(parent a) 13 | # add_module(parent b) 14 | # target_link_libraries(project.libparent.b PUBLIC project.libparent.a) 15 | function(add_module parent name) 16 | set(target ${PROJECT_NAME}.lib${parent}.${name}) 17 | add_library(${target} OBJECT) 18 | file(GLOB_RECURSE sources CONFIGURE_DEPENDS 19 | "${CMAKE_CURRENT_SOURCE_DIR}/src/lib${parent}/${name}/*.cpp" 20 | ) 21 | target_sources(${target} PRIVATE ${sources}) 22 | target_include_directories(${target} PUBLIC 23 | "$" 24 | ) 25 | isolate_headers( 26 | ${target} 27 | "${CMAKE_CURRENT_SOURCE_DIR}/include" 28 | "${CMAKE_CURRENT_SOURCE_DIR}/include/${parent}/${name}" 29 | PUBLIC 30 | ) 31 | isolate_headers( 32 | ${target} 33 | "${CMAKE_CURRENT_SOURCE_DIR}/src" 34 | "${CMAKE_CURRENT_SOURCE_DIR}/src/lib${parent}/${name}" 35 | PRIVATE 36 | ) 37 | endfunction() 38 | -------------------------------------------------------------------------------- /cmake/create_symbolic_link.cmake: -------------------------------------------------------------------------------- 1 | # file(CREATE_SYMLINK) only works on Windows with administrator privileges. 2 | # https://stackoverflow.com/a/61244115/618906 3 | function(create_symbolic_link target link) 4 | if(WIN32) 5 | if(NOT IS_SYMLINK "${link}") 6 | if(NOT IS_ABSOLUTE "${target}") 7 | # Relative links work do not work on Windows. 8 | set(target "${link}/../${target}") 9 | endif() 10 | file(TO_NATIVE_PATH "${target}" target) 11 | file(TO_NATIVE_PATH "${link}" link) 12 | execute_process(COMMAND cmd.exe /c mklink /J "${link}" "${target}") 13 | endif() 14 | else() 15 | file(CREATE_LINK "${target}" "${link}" SYMBOLIC) 16 | endif() 17 | if(NOT IS_SYMLINK "${link}") 18 | message(ERROR "failed to create symlink: <${link}>") 19 | endif() 20 | endfunction() 21 | -------------------------------------------------------------------------------- /cmake/isolate_headers.cmake: -------------------------------------------------------------------------------- 1 | include(create_symbolic_link) 2 | 3 | # Consider include directory B nested under prefix A: 4 | # 5 | # /path/to/A/then/to/B/... 6 | # 7 | # Call C the relative path from A to B. 8 | # C is what we want to write in `#include` directives: 9 | # 10 | # #include 11 | # 12 | # Examples, all from the `jobqueue` module: 13 | # 14 | # - Library public headers: 15 | # B = /include/xrpl/jobqueue 16 | # A = /include/ 17 | # C = xrpl/jobqueue 18 | # 19 | # - Library private headers: 20 | # B = /src/libxrpl/jobqueue 21 | # A = /src/ 22 | # C = libxrpl/jobqueue 23 | # 24 | # - Test private headers: 25 | # B = /tests/jobqueue 26 | # A = / 27 | # C = tests/jobqueue 28 | # 29 | # To isolate headers from each other, 30 | # we want to create a symlink Y that points to B, 31 | # within a subdirectory X of the `CMAKE_BINARY_DIR`, 32 | # that has the same relative path C between X and Y, 33 | # and then add X as an include directory of the target, 34 | # sometimes `PUBLIC` and sometimes `PRIVATE`. 35 | # The Cs are all guaranteed to be unique. 36 | # We can guarantee a unique X per target by using 37 | # `${CMAKE_CURRENT_BINARY_DIR}/include/${target}`. 38 | # 39 | # isolate_headers(target A B scope) 40 | function(isolate_headers target A B scope) 41 | file(RELATIVE_PATH C "${A}" "${B}") 42 | set(X "${CMAKE_CURRENT_BINARY_DIR}/modules/${target}") 43 | set(Y "${X}/${C}") 44 | cmake_path(GET Y PARENT_PATH parent) 45 | file(MAKE_DIRECTORY "${parent}") 46 | create_symbolic_link("${B}" "${Y}") 47 | target_include_directories(${target} ${scope} "$") 48 | endfunction() 49 | -------------------------------------------------------------------------------- /cmake/target_link_modules.cmake: -------------------------------------------------------------------------------- 1 | # Link a library to its modules (see: `add_module`) 2 | # and remove the module sources from the library's sources. 3 | # 4 | # add_module(parent a) 5 | # add_module(parent b) 6 | # target_link_libraries(project.libparent.b PUBLIC project.libparent.a) 7 | # add_library(project.libparent) 8 | # target_link_modules(parent PUBLIC a b) 9 | function(target_link_modules parent scope) 10 | set(library ${PROJECT_NAME}.lib${parent}) 11 | foreach(name ${ARGN}) 12 | set(module ${library}.${name}) 13 | get_target_property(sources ${library} SOURCES) 14 | list(LENGTH sources before) 15 | get_target_property(dupes ${module} SOURCES) 16 | list(LENGTH dupes expected) 17 | list(REMOVE_ITEM sources ${dupes}) 18 | list(LENGTH sources after) 19 | math(EXPR actual "${before} - ${after}") 20 | message(STATUS "${module} with ${expected} sources took ${actual} sources from ${library}") 21 | set_target_properties(${library} PROPERTIES SOURCES "${sources}") 22 | target_link_libraries(${library} ${scope} ${module}) 23 | endforeach() 24 | endfunction() 25 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | html 2 | temp 3 | out.txt 4 | -------------------------------------------------------------------------------- /docs/0001-negative-unl/negativeUNL_highLevel_sequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRPLF/rippled/35a40a8e6236110bfbaa96d9a891728b4bae8a4e/docs/0001-negative-unl/negativeUNL_highLevel_sequence.png -------------------------------------------------------------------------------- /docs/0010-ledger-replay/ledger_replay_classes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRPLF/rippled/35a40a8e6236110bfbaa96d9a891728b4bae8a4e/docs/0010-ledger-replay/ledger_replay_classes.png -------------------------------------------------------------------------------- /docs/0010-ledger-replay/ledger_replay_sequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRPLF/rippled/35a40a8e6236110bfbaa96d9a891728b4bae8a4e/docs/0010-ledger-replay/ledger_replay_sequence.png -------------------------------------------------------------------------------- /docs/CheatSheet.md: -------------------------------------------------------------------------------- 1 | # Code Style Cheat Sheet 2 | 3 | ## Form 4 | 5 | - One class per header file. 6 | - Place each data member on its own line. 7 | - Place each ctor-initializer on its own line. 8 | - Create typedefs for primitive types to describe them. 9 | - Return descriptive local variables instead of constants. 10 | - Use long descriptive names instead of abbreviations. 11 | - Use "explicit" for single-argument ctors 12 | - Avoid globals especially objects with static storage duration 13 | - Order class declarations as types, public, protected, private, then data. 14 | - Prefer 'private' over 'protected' 15 | 16 | ## Function 17 | 18 | - Minimize external dependencies 19 | * Pass options in the ctor instead of using theConfig 20 | * Use as few other classes as possible 21 | -------------------------------------------------------------------------------- /docs/Docker.md: -------------------------------------------------------------------------------- 1 | # `rippled` Docker Image 2 | 3 | - Some info relating to Docker containers can be found here: [../Builds/containers](../Builds/containers) 4 | - Images for building and testing rippled can be found here: [thejohnfreeman/rippled-docker](https://github.com/thejohnfreeman/rippled-docker/) 5 | - These images do not have rippled. They have all the tools necessary to build rippled. 6 | -------------------------------------------------------------------------------- /docs/NodeStoreRefactoringCaseStudy.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRPLF/rippled/35a40a8e6236110bfbaa96d9a891728b4bae8a4e/docs/NodeStoreRefactoringCaseStudy.pdf -------------------------------------------------------------------------------- /docs/images/consensus/EffCloseTime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRPLF/rippled/35a40a8e6236110bfbaa96d9a891728b4bae8a4e/docs/images/consensus/EffCloseTime.png -------------------------------------------------------------------------------- /docs/images/consensus/block_chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRPLF/rippled/35a40a8e6236110bfbaa96d9a891728b4bae8a4e/docs/images/consensus/block_chain.png -------------------------------------------------------------------------------- /docs/images/consensus/consensus_modes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRPLF/rippled/35a40a8e6236110bfbaa96d9a891728b4bae8a4e/docs/images/consensus/consensus_modes.png -------------------------------------------------------------------------------- /docs/images/consensus/consensus_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRPLF/rippled/35a40a8e6236110bfbaa96d9a891728b4bae8a4e/docs/images/consensus/consensus_overview.png -------------------------------------------------------------------------------- /docs/images/consensus/disputes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRPLF/rippled/35a40a8e6236110bfbaa96d9a891728b4bae8a4e/docs/images/consensus/disputes.png -------------------------------------------------------------------------------- /docs/images/consensus/ledger_chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRPLF/rippled/35a40a8e6236110bfbaa96d9a891728b4bae8a4e/docs/images/consensus/ledger_chain.png -------------------------------------------------------------------------------- /docs/images/consensus/threshold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRPLF/rippled/35a40a8e6236110bfbaa96d9a891728b4bae8a4e/docs/images/consensus/threshold.png -------------------------------------------------------------------------------- /docs/images/xrp-text-mark-black-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRPLF/rippled/35a40a8e6236110bfbaa96d9a891728b4bae8a4e/docs/images/xrp-text-mark-black-small@2x.png -------------------------------------------------------------------------------- /docs/sample_chart.doc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page somestatechart Example state diagram 3 | 4 | \startuml SomeState "my state diagram" 5 | scale 600 width 6 | 7 | [*] -> State1 8 | State1 --> State2 : Succeeded 9 | State1 --> [*] : Aborted 10 | State2 --> State3 : Succeeded 11 | State2 --> [*] : Aborted 12 | state State3 { 13 | state "Accumulate Enough Data\nLong State Name" as long1 14 | long1 : Just a test 15 | [*] --> long1 16 | long1 --> long1 : New Data 17 | long1 --> ProcessData : Enough Data 18 | } 19 | State3 --> State3 : Failed 20 | State3 --> [*] : Succeeded / Save Result 21 | State3 --> [*] : Aborted 22 | 23 | \enduml 24 | */ 25 | -------------------------------------------------------------------------------- /external/README.md: -------------------------------------------------------------------------------- 1 | # External Conan recipes 2 | 3 | The subdirectories in this directory contain either copies or Conan recipes 4 | of external libraries used by rippled. 5 | The Conan recipes include patches we have not yet pushed upstream. 6 | 7 | | Folder | Upstream | Description | 8 | |:----------------|:---------------------------------------------|:------------| 9 | | `antithesis-sdk`| [Project](https://github.com/antithesishq/antithesis-sdk-cpp/) | [Antithesis](https://antithesis.com/docs/using_antithesis/sdk/cpp/overview.html) SDK for C++ | 10 | | `ed25519-donna` | [Project](https://github.com/floodyberry/ed25519-donna) | [Ed25519](http://ed25519.cr.yp.to/) digital signatures | 11 | | `rocksdb` | [Recipe](https://github.com/conan-io/conan-center-index/tree/master/recipes/rocksdb) | Fast key/value database. (Supports rotational disks better than NuDB.) | 12 | | `secp256k1` | [Project](https://github.com/bitcoin-core/secp256k1) | ECDSA digital signatures using the **secp256k1** curve | 13 | | `snappy` | [Recipe](https://github.com/conan-io/conan-center-index/tree/master/recipes/snappy) | "Snappy" lossless compression algorithm. | 14 | | `soci` | [Recipe](https://github.com/conan-io/conan-center-index/tree/master/recipes/soci) | Abstraction layer for database access. | 15 | -------------------------------------------------------------------------------- /external/antithesis-sdk/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | DisableFormat: true 3 | SortIncludes: false 4 | -------------------------------------------------------------------------------- /external/antithesis-sdk/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.25) 2 | 3 | # Note, version set explicitly by rippled project 4 | project(antithesis-sdk-cpp VERSION 0.4.4 LANGUAGES CXX) 5 | 6 | add_library(antithesis-sdk-cpp INTERFACE antithesis_sdk.h) 7 | 8 | # Note, both sections below created by rippled project 9 | target_include_directories(antithesis-sdk-cpp INTERFACE 10 | $ 11 | $ 12 | ) 13 | 14 | install( 15 | FILES antithesis_sdk.h 16 | DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" 17 | ) 18 | -------------------------------------------------------------------------------- /external/antithesis-sdk/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Antithesis 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /external/antithesis-sdk/README.md: -------------------------------------------------------------------------------- 1 | # Antithesis C++ SDK 2 | 3 | This library provides methods for C++ programs to configure the [Antithesis](https://antithesis.com) platform. It contains three kinds of functionality: 4 | * Assertion macros that allow you to define test properties about your software or workload. 5 | * Randomness functions for requesting both structured and unstructured randomness from the Antithesis platform. 6 | * Lifecycle functions that inform the Antithesis environment that particular test phases or milestones have been reached. 7 | 8 | For general usage guidance see the [Antithesis C++ SDK Documentation](https://antithesis.com/docs/using_antithesis/sdk/cpp/overview/) 9 | -------------------------------------------------------------------------------- /external/ed25519-donna/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.11) 2 | 3 | project(ed25519 4 | LANGUAGES C 5 | ) 6 | 7 | if(PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME) 8 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/output/$/lib") 9 | endif() 10 | 11 | if(NOT TARGET OpenSSL::SSL) 12 | find_package(OpenSSL) 13 | endif() 14 | 15 | add_library(ed25519 STATIC 16 | ed25519.c 17 | ) 18 | add_library(ed25519::ed25519 ALIAS ed25519) 19 | target_link_libraries(ed25519 PUBLIC OpenSSL::SSL) 20 | 21 | include(GNUInstallDirs) 22 | 23 | #[=========================================================[ 24 | NOTE for macos: 25 | https://github.com/floodyberry/ed25519-donna/issues/29 26 | our source for ed25519-donna-portable.h has been 27 | patched to workaround this. 28 | #]=========================================================] 29 | target_include_directories(ed25519 PUBLIC 30 | $ 31 | $ 32 | ) 33 | 34 | install( 35 | TARGETS ed25519 36 | EXPORT ${PROJECT_NAME}-exports 37 | ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" 38 | ) 39 | install( 40 | EXPORT ${PROJECT_NAME}-exports 41 | DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" 42 | FILE ${PROJECT_NAME}-targets.cmake 43 | NAMESPACE ${PROJECT_NAME}:: 44 | ) 45 | install( 46 | FILES ed25519.h 47 | DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" 48 | ) 49 | -------------------------------------------------------------------------------- /external/ed25519-donna/ed25519-hash-custom.h: -------------------------------------------------------------------------------- 1 | /* 2 | a custom hash must have a 512bit digest and implement: 3 | 4 | struct ed25519_hash_context; 5 | 6 | void ed25519_hash_init(ed25519_hash_context *ctx); 7 | void ed25519_hash_update(ed25519_hash_context *ctx, const uint8_t *in, size_t inlen); 8 | void ed25519_hash_final(ed25519_hash_context *ctx, uint8_t *hash); 9 | void ed25519_hash(uint8_t *hash, const uint8_t *in, size_t inlen); 10 | */ 11 | 12 | -------------------------------------------------------------------------------- /external/ed25519-donna/ed25519-randombytes-custom.h: -------------------------------------------------------------------------------- 1 | /* 2 | a custom randombytes must implement: 3 | 4 | void ED25519_FN(ed25519_randombytes_unsafe) (void *p, size_t len); 5 | 6 | ed25519_randombytes_unsafe is used by the batch verification function 7 | to create random scalars 8 | */ 9 | -------------------------------------------------------------------------------- /external/ed25519-donna/ed25519.h: -------------------------------------------------------------------------------- 1 | #ifndef ED25519_H 2 | #define ED25519_H 3 | 4 | #include 5 | 6 | #if defined(__cplusplus) 7 | extern "C" { 8 | #endif 9 | 10 | typedef unsigned char ed25519_signature[64]; 11 | typedef unsigned char ed25519_public_key[32]; 12 | typedef unsigned char ed25519_secret_key[32]; 13 | 14 | typedef unsigned char curved25519_key[32]; 15 | 16 | void ed25519_publickey(const ed25519_secret_key sk, ed25519_public_key pk); 17 | int ed25519_sign_open(const unsigned char *m, size_t mlen, const ed25519_public_key pk, const ed25519_signature RS); 18 | void ed25519_sign(const unsigned char *m, size_t mlen, const ed25519_secret_key sk, const ed25519_public_key pk, ed25519_signature RS); 19 | 20 | int ed25519_sign_open_batch(const unsigned char **m, size_t *mlen, const unsigned char **pk, const unsigned char **RS, size_t num, int *valid); 21 | 22 | void ed25519_randombytes_unsafe(void *out, size_t count); 23 | 24 | void curved25519_scalarmult_basepoint(curved25519_key pk, const curved25519_key e); 25 | 26 | #if defined(__cplusplus) 27 | } 28 | #endif 29 | 30 | #endif // ED25519_H 31 | -------------------------------------------------------------------------------- /external/ed25519-donna/fuzz/curve25519-ref10.h: -------------------------------------------------------------------------------- 1 | #ifndef CURVE25519_REF10_H 2 | #define CURVE25519_REF10_H 3 | 4 | int crypto_scalarmult_base_ref10(unsigned char *q,const unsigned char *n); 5 | int crypto_scalarmult_ref10(unsigned char *q, const unsigned char *n, const unsigned char *p); 6 | 7 | #endif /* CURVE25519_REF10_H */ 8 | 9 | -------------------------------------------------------------------------------- /external/ed25519-donna/fuzz/ed25519-donna-sse2.c: -------------------------------------------------------------------------------- 1 | #define ED25519_SUFFIX _sse2 2 | #define ED25519_SSE2 3 | #include "../ed25519.c" 4 | -------------------------------------------------------------------------------- /external/ed25519-donna/fuzz/ed25519-donna.c: -------------------------------------------------------------------------------- 1 | #include "../ed25519.c" 2 | -------------------------------------------------------------------------------- /external/ed25519-donna/fuzz/ed25519-ref10.h: -------------------------------------------------------------------------------- 1 | #ifndef ED25519_REF10_H 2 | #define ED25519_REF10_H 3 | 4 | int crypto_sign_pk_ref10(unsigned char *pk,unsigned char *sk); 5 | int crypto_sign_ref10(unsigned char *sm,unsigned long long *smlen,const unsigned char *m,unsigned long long mlen,const unsigned char *sk); 6 | int crypto_sign_open_ref10(unsigned char *m,unsigned long long *mlen,const unsigned char *sm,unsigned long long smlen,const unsigned char *pk); 7 | 8 | #endif /* ED25519_REF10_H */ 9 | 10 | -------------------------------------------------------------------------------- /external/ed25519-donna/test-ticks.h: -------------------------------------------------------------------------------- 1 | #include "ed25519-donna-portable-identify.h" 2 | 3 | /* ticks - not tested on anything other than x86 */ 4 | static uint64_t 5 | get_ticks(void) { 6 | #if defined(CPU_X86) || defined(CPU_X86_64) 7 | #if defined(COMPILER_INTEL) 8 | return _rdtsc(); 9 | #elif defined(COMPILER_MSVC) 10 | return __rdtsc(); 11 | #elif defined(COMPILER_GCC) 12 | uint32_t lo, hi; 13 | __asm__ __volatile__("rdtsc" : "=a" (lo), "=d" (hi)); 14 | return ((uint64_t)lo | ((uint64_t)hi << 32)); 15 | #else 16 | need rdtsc for this compiler 17 | #endif 18 | #elif defined(OS_SOLARIS) 19 | return (uint64_t)gethrtime(); 20 | #elif defined(CPU_SPARC) && !defined(OS_OPENBSD) 21 | uint64_t t; 22 | __asm__ __volatile__("rd %%tick, %0" : "=r" (t)); 23 | return t; 24 | #elif defined(CPU_PPC) 25 | uint32_t lo = 0, hi = 0; 26 | __asm__ __volatile__("mftbu %0; mftb %1" : "=r" (hi), "=r" (lo)); 27 | return ((uint64_t)lo | ((uint64_t)hi << 32)); 28 | #elif defined(CPU_IA64) 29 | uint64_t t; 30 | __asm__ __volatile__("mov %0=ar.itc" : "=r" (t)); 31 | return t; 32 | #elif defined(OS_NIX) 33 | timeval t2; 34 | gettimeofday(&t2, NULL); 35 | t = ((uint64_t)t2.tv_usec << 32) | (uint64_t)t2.tv_sec; 36 | return t; 37 | #else 38 | need ticks for this platform 39 | #endif 40 | } 41 | 42 | #define timeit(x,minvar) \ 43 | ticks = get_ticks(); \ 44 | x; \ 45 | ticks = get_ticks() - ticks; \ 46 | if (ticks < minvar) \ 47 | minvar = ticks; 48 | 49 | #define maxticks 0xffffffffffffffffull 50 | 51 | -------------------------------------------------------------------------------- /external/nudb/conandata.yml: -------------------------------------------------------------------------------- 1 | sources: 2 | "2.0.8": 3 | url: "https://github.com/CPPAlliance/NuDB/archive/2.0.8.tar.gz" 4 | sha256: "9b71903d8ba111cd893ab064b9a8b6ac4124ed8bd6b4f67250205bc43c7f13a8" 5 | patches: 6 | "2.0.8": 7 | - patch_file: "patches/2.0.8-0001-add-include-stdexcept-for-msvc.patch" 8 | patch_description: "Fix build for MSVC by including stdexcept" 9 | patch_type: "portability" 10 | patch_source: "https://github.com/cppalliance/NuDB/pull/100/files" 11 | -------------------------------------------------------------------------------- /external/nudb/patches/2.0.8-0001-add-include-stdexcept-for-msvc.patch: -------------------------------------------------------------------------------- 1 | diff --git a/include/nudb/detail/stream.hpp b/include/nudb/detail/stream.hpp 2 | index 6c07bf1..e0ce8ed 100644 3 | --- a/include/nudb/detail/stream.hpp 4 | +++ b/include/nudb/detail/stream.hpp 5 | @@ -14,6 +14,7 @@ 6 | #include 7 | #include 8 | #include 9 | +#include 10 | 11 | namespace nudb { 12 | namespace detail { 13 | diff --git a/include/nudb/impl/context.ipp b/include/nudb/impl/context.ipp 14 | index beb7058..ffde0b3 100644 15 | --- a/include/nudb/impl/context.ipp 16 | +++ b/include/nudb/impl/context.ipp 17 | @@ -9,6 +9,7 @@ 18 | #define NUDB_IMPL_CONTEXT_IPP 19 | 20 | #include 21 | +#include 22 | 23 | namespace nudb { 24 | 25 | -------------------------------------------------------------------------------- /external/rocksdb/conandata.yml: -------------------------------------------------------------------------------- 1 | sources: 2 | "9.7.3": 3 | url: "https://github.com/facebook/rocksdb/archive/refs/tags/v9.7.3.tar.gz" 4 | sha256: "acfabb989cbfb5b5c4d23214819b059638193ec33dad2d88373c46448d16d38b" 5 | patches: 6 | "9.7.3": 7 | - patch_file: "patches/9.x.x-0001-exclude-thirdparty.patch" 8 | patch_description: "Do not include thirdparty.inc" 9 | patch_type: "portability" 10 | - patch_file: "patches/9.7.3-0001-memory-leak.patch" 11 | patch_description: "Fix a leak of obsolete blob files left open until DB::Close()" 12 | patch_type: "portability" 13 | -------------------------------------------------------------------------------- /external/rocksdb/patches/9.x.x-0001-exclude-thirdparty.patch: -------------------------------------------------------------------------------- 1 | diff --git a/CMakeLists.txt b/CMakeLists.txt 2 | index 93b884d..b715cb6 100644 3 | --- a/CMakeLists.txt 4 | +++ b/CMakeLists.txt 5 | @@ -106,14 +106,9 @@ endif() 6 | include(CMakeDependentOption) 7 | 8 | if(MSVC) 9 | - option(WITH_GFLAGS "build with GFlags" OFF) 10 | option(WITH_XPRESS "build with windows built in compression" OFF) 11 | - option(ROCKSDB_SKIP_THIRDPARTY "skip thirdparty.inc" OFF) 12 | - 13 | - if(NOT ROCKSDB_SKIP_THIRDPARTY) 14 | - include(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty.inc) 15 | - endif() 16 | -else() 17 | +endif() 18 | +if(TRUE) 19 | if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" AND NOT CMAKE_SYSTEM_NAME MATCHES "kFreeBSD") 20 | # FreeBSD has jemalloc as default malloc 21 | # but it does not have all the jemalloc files in include/... 22 | @@ -126,7 +121,7 @@ else() 23 | endif() 24 | endif() 25 | 26 | - if(MINGW) 27 | + if(MSVC OR MINGW) 28 | option(WITH_GFLAGS "build with GFlags" OFF) 29 | else() 30 | option(WITH_GFLAGS "build with GFlags" ON) 31 | -------------------------------------------------------------------------------- /external/secp256k1/.gitattributes: -------------------------------------------------------------------------------- 1 | src/precomputed_ecmult.c linguist-generated 2 | src/precomputed_ecmult_gen.c linguist-generated 3 | -------------------------------------------------------------------------------- /external/secp256k1/.gitignore: -------------------------------------------------------------------------------- 1 | bench 2 | bench_ecmult 3 | bench_internal 4 | noverify_tests 5 | tests 6 | exhaustive_tests 7 | precompute_ecmult_gen 8 | precompute_ecmult 9 | ctime_tests 10 | ecdh_example 11 | ecdsa_example 12 | schnorr_example 13 | ellswift_example 14 | musig_example 15 | *.exe 16 | *.so 17 | *.a 18 | *.csv 19 | *.log 20 | *.trs 21 | *.sage.py 22 | 23 | Makefile 24 | configure 25 | .libs/ 26 | Makefile.in 27 | aclocal.m4 28 | autom4te.cache/ 29 | config.log 30 | config.status 31 | conftest* 32 | *.tar.gz 33 | *.la 34 | libtool 35 | .deps/ 36 | .dirstamp 37 | *.lo 38 | *.o 39 | *~ 40 | 41 | coverage/ 42 | coverage.html 43 | coverage.*.html 44 | *.gcda 45 | *.gcno 46 | *.gcov 47 | 48 | build-aux/ar-lib 49 | build-aux/config.guess 50 | build-aux/config.sub 51 | build-aux/depcomp 52 | build-aux/install-sh 53 | build-aux/ltmain.sh 54 | build-aux/m4/libtool.m4 55 | build-aux/m4/lt~obsolete.m4 56 | build-aux/m4/ltoptions.m4 57 | build-aux/m4/ltsugar.m4 58 | build-aux/m4/ltversion.m4 59 | build-aux/missing 60 | build-aux/compile 61 | build-aux/test-driver 62 | libsecp256k1.pc 63 | 64 | ### CMake 65 | /CMakeUserPresets.json 66 | # Default CMake build directory. 67 | /build 68 | -------------------------------------------------------------------------------- /external/secp256k1/CMakePresets.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmakeMinimumRequired": {"major": 3, "minor": 21, "patch": 0}, 3 | "version": 3, 4 | "configurePresets": [ 5 | { 6 | "name": "dev-mode", 7 | "displayName": "Development mode (intended only for developers of the library)", 8 | "cacheVariables": { 9 | "SECP256K1_EXPERIMENTAL": "ON", 10 | "SECP256K1_ENABLE_MODULE_RECOVERY": "ON", 11 | "SECP256K1_BUILD_EXAMPLES": "ON" 12 | }, 13 | "warnings": { 14 | "dev": true, 15 | "uninitialized": true 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /external/secp256k1/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Pieter Wuille 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /external/secp256k1/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Reporting a Vulnerability 4 | 5 | To report security issues send an email to secp256k1-security@bitcoincore.org (not for support). 6 | 7 | The following keys may be used to communicate sensitive information to developers: 8 | 9 | | Name | Fingerprint | 10 | |------|-------------| 11 | | Pieter Wuille | 133E AC17 9436 F14A 5CF1 B794 860F EB80 4E66 9320 | 12 | | Jonas Nick | 36C7 1A37 C9D9 88BD E825 08D9 B1A7 0E4F 8DCD 0366 | 13 | | Tim Ruffing | 09E0 3F87 1092 E40E 106E 902B 33BC 86AB 80FF 5516 | 14 | 15 | You can import a key by running the following command with that individual’s fingerprint: `gpg --keyserver hkps://keys.openpgp.org --recv-keys ""` Ensure that you put quotes around fingerprints containing spaces. 16 | -------------------------------------------------------------------------------- /external/secp256k1/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | autoreconf -if --warnings=all 4 | -------------------------------------------------------------------------------- /external/secp256k1/cmake/CheckArm32Assembly.cmake: -------------------------------------------------------------------------------- 1 | function(check_arm32_assembly) 2 | try_compile(HAVE_ARM32_ASM 3 | ${PROJECT_BINARY_DIR}/check_arm32_assembly 4 | SOURCES ${PROJECT_SOURCE_DIR}/cmake/source_arm32.s 5 | ) 6 | endfunction() 7 | -------------------------------------------------------------------------------- /external/secp256k1/cmake/CheckMemorySanitizer.cmake: -------------------------------------------------------------------------------- 1 | include_guard(GLOBAL) 2 | include(CheckCSourceCompiles) 3 | 4 | function(check_memory_sanitizer output) 5 | set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) 6 | check_c_source_compiles(" 7 | #if defined(__has_feature) 8 | # if __has_feature(memory_sanitizer) 9 | /* MemorySanitizer is enabled. */ 10 | # elif 11 | # error \"MemorySanitizer is disabled.\" 12 | # endif 13 | #else 14 | # error \"__has_feature is not defined.\" 15 | #endif 16 | " HAVE_MSAN) 17 | set(${output} ${HAVE_MSAN} PARENT_SCOPE) 18 | endfunction() 19 | -------------------------------------------------------------------------------- /external/secp256k1/cmake/CheckStringOptionValue.cmake: -------------------------------------------------------------------------------- 1 | function(check_string_option_value option) 2 | get_property(expected_values CACHE ${option} PROPERTY STRINGS) 3 | if(expected_values) 4 | if(${option} IN_LIST expected_values) 5 | return() 6 | endif() 7 | message(FATAL_ERROR "${option} value is \"${${option}}\", but must be one of ${expected_values}.") 8 | endif() 9 | message(AUTHOR_WARNING "The STRINGS property must be set before invoking `check_string_option_value' function.") 10 | endfunction() 11 | -------------------------------------------------------------------------------- /external/secp256k1/cmake/CheckX86_64Assembly.cmake: -------------------------------------------------------------------------------- 1 | include(CheckCSourceCompiles) 2 | 3 | function(check_x86_64_assembly) 4 | check_c_source_compiles(" 5 | #include 6 | 7 | int main() 8 | { 9 | uint64_t a = 11, tmp; 10 | __asm__ __volatile__(\"movq $0x100000000,%1; mulq %%rsi\" : \"+a\"(a) : \"S\"(tmp) : \"cc\", \"%rdx\"); 11 | } 12 | " HAVE_X86_64_ASM) 13 | set(HAVE_X86_64_ASM ${HAVE_X86_64_ASM} PARENT_SCOPE) 14 | endfunction() 15 | -------------------------------------------------------------------------------- /external/secp256k1/cmake/FindValgrind.cmake: -------------------------------------------------------------------------------- 1 | if(CMAKE_HOST_APPLE) 2 | find_program(BREW_COMMAND brew) 3 | execute_process( 4 | COMMAND ${BREW_COMMAND} --prefix valgrind 5 | OUTPUT_VARIABLE valgrind_brew_prefix 6 | ERROR_QUIET 7 | OUTPUT_STRIP_TRAILING_WHITESPACE 8 | ) 9 | endif() 10 | 11 | set(hints_paths) 12 | if(valgrind_brew_prefix) 13 | set(hints_paths ${valgrind_brew_prefix}/include) 14 | endif() 15 | 16 | find_path(Valgrind_INCLUDE_DIR 17 | NAMES valgrind/memcheck.h 18 | HINTS ${hints_paths} 19 | ) 20 | 21 | if(Valgrind_INCLUDE_DIR) 22 | include(CheckCSourceCompiles) 23 | set(CMAKE_REQUIRED_INCLUDES ${Valgrind_INCLUDE_DIR}) 24 | check_c_source_compiles(" 25 | #include 26 | #if defined(NVALGRIND) 27 | # error \"Valgrind does not support this platform.\" 28 | #endif 29 | 30 | int main() {} 31 | " Valgrind_WORKS) 32 | endif() 33 | 34 | include(FindPackageHandleStandardArgs) 35 | find_package_handle_standard_args(Valgrind 36 | REQUIRED_VARS Valgrind_INCLUDE_DIR Valgrind_WORKS 37 | ) 38 | 39 | mark_as_advanced( 40 | Valgrind_INCLUDE_DIR 41 | ) 42 | -------------------------------------------------------------------------------- /external/secp256k1/cmake/GeneratePkgConfigFile.cmake: -------------------------------------------------------------------------------- 1 | function(generate_pkg_config_file in_file) 2 | set(prefix ${CMAKE_INSTALL_PREFIX}) 3 | set(exec_prefix \${prefix}) 4 | set(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR}) 5 | set(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR}) 6 | set(PACKAGE_VERSION ${PROJECT_VERSION}) 7 | configure_file(${in_file} ${PROJECT_NAME}.pc @ONLY) 8 | endfunction() 9 | -------------------------------------------------------------------------------- /external/secp256k1/cmake/TryAppendCFlags.cmake: -------------------------------------------------------------------------------- 1 | include(CheckCCompilerFlag) 2 | 3 | function(secp256k1_check_c_flags_internal flags output) 4 | string(MAKE_C_IDENTIFIER "${flags}" result) 5 | string(TOUPPER "${result}" result) 6 | set(result "C_SUPPORTS_${result}") 7 | if(NOT MSVC) 8 | set(CMAKE_REQUIRED_FLAGS "-Werror") 9 | endif() 10 | 11 | # This avoids running a linker. 12 | set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) 13 | check_c_compiler_flag("${flags}" ${result}) 14 | 15 | set(${output} ${${result}} PARENT_SCOPE) 16 | endfunction() 17 | 18 | # Append flags to the COMPILE_OPTIONS directory property if CC accepts them. 19 | macro(try_append_c_flags) 20 | secp256k1_check_c_flags_internal("${ARGV}" result) 21 | if(result) 22 | add_compile_options(${ARGV}) 23 | endif() 24 | endmacro() 25 | -------------------------------------------------------------------------------- /external/secp256k1/cmake/arm-linux-gnueabihf.toolchain.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_SYSTEM_NAME Linux) 2 | set(CMAKE_SYSTEM_PROCESSOR arm) 3 | set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) 4 | -------------------------------------------------------------------------------- /external/secp256k1/cmake/config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") 4 | 5 | check_required_components(@PROJECT_NAME@) 6 | -------------------------------------------------------------------------------- /external/secp256k1/cmake/source_arm32.s: -------------------------------------------------------------------------------- 1 | .syntax unified 2 | .eabi_attribute 24, 1 3 | .eabi_attribute 25, 1 4 | .text 5 | .global main 6 | main: 7 | ldr r0, =0x002A 8 | mov r7, #1 9 | swi 0 10 | -------------------------------------------------------------------------------- /external/secp256k1/cmake/x86_64-w64-mingw32.toolchain.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_SYSTEM_NAME Windows) 2 | set(CMAKE_SYSTEM_PROCESSOR x86_64) 3 | set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc) 4 | -------------------------------------------------------------------------------- /external/secp256k1/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | function(add_example name) 2 | set(target_name ${name}_example) 3 | add_executable(${target_name} ${name}.c) 4 | target_include_directories(${target_name} PRIVATE 5 | ${PROJECT_SOURCE_DIR}/include 6 | ) 7 | target_link_libraries(${target_name} 8 | secp256k1 9 | $<$:bcrypt> 10 | ) 11 | set(test_name ${name}_example) 12 | add_test(NAME secp256k1_${test_name} COMMAND ${target_name}) 13 | endfunction() 14 | 15 | add_example(ecdsa) 16 | 17 | if(SECP256K1_ENABLE_MODULE_ECDH) 18 | add_example(ecdh) 19 | endif() 20 | 21 | if(SECP256K1_ENABLE_MODULE_SCHNORRSIG) 22 | add_example(schnorr) 23 | endif() 24 | 25 | if(SECP256K1_ENABLE_MODULE_ELLSWIFT) 26 | add_example(ellswift) 27 | endif() 28 | 29 | if(SECP256K1_ENABLE_MODULE_MUSIG) 30 | add_example(musig) 31 | endif() 32 | -------------------------------------------------------------------------------- /external/secp256k1/libsecp256k1.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libsecp256k1 7 | Description: Optimized C library for EC operations on curve secp256k1 8 | URL: https://github.com/bitcoin-core/secp256k1 9 | Version: @PACKAGE_VERSION@ 10 | Cflags: -I${includedir} 11 | Libs: -L${libdir} -lsecp256k1 12 | 13 | -------------------------------------------------------------------------------- /external/secp256k1/sage/secp256k1_params.sage: -------------------------------------------------------------------------------- 1 | """Prime order of finite field underlying secp256k1 (2^256 - 2^32 - 977)""" 2 | P = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F 3 | 4 | """Finite field underlying secp256k1""" 5 | F = FiniteField(P) 6 | 7 | """Elliptic curve secp256k1: y^2 = x^3 + 7""" 8 | C = EllipticCurve([F(0), F(7)]) 9 | 10 | """Base point of secp256k1""" 11 | G = C.lift_x(0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798) 12 | if int(G[1]) & 1: 13 | # G.y is even 14 | G = -G 15 | 16 | """Prime order of secp256k1""" 17 | N = C.order() 18 | 19 | """Finite field of scalars of secp256k1""" 20 | Z = FiniteField(N) 21 | 22 | """ Beta value of secp256k1 non-trivial endomorphism: lambda * (x, y) = (beta * x, y)""" 23 | BETA = F(2)^((P-1)/3) 24 | 25 | """ Lambda value of secp256k1 non-trivial endomorphism: lambda * (x, y) = (beta * x, y)""" 26 | LAMBDA = Z(3)^((N-1)/3) 27 | 28 | assert is_prime(P) 29 | assert is_prime(N) 30 | 31 | assert BETA != F(1) 32 | assert BETA^3 == F(1) 33 | assert BETA^2 + BETA + 1 == 0 34 | 35 | assert LAMBDA != Z(1) 36 | assert LAMBDA^3 == Z(1) 37 | assert LAMBDA^2 + LAMBDA + 1 == 0 38 | 39 | assert Integer(LAMBDA)*G == C(BETA*G[0], G[1]) 40 | -------------------------------------------------------------------------------- /external/secp256k1/src/ecdsa.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or https://www.opensource.org/licenses/mit-license.php.* 5 | ***********************************************************************/ 6 | 7 | #ifndef SECP256K1_ECDSA_H 8 | #define SECP256K1_ECDSA_H 9 | 10 | #include 11 | 12 | #include "scalar.h" 13 | #include "group.h" 14 | #include "ecmult.h" 15 | 16 | static int secp256k1_ecdsa_sig_parse(secp256k1_scalar *r, secp256k1_scalar *s, const unsigned char *sig, size_t size); 17 | static int secp256k1_ecdsa_sig_serialize(unsigned char *sig, size_t *size, const secp256k1_scalar *r, const secp256k1_scalar *s); 18 | static int secp256k1_ecdsa_sig_verify(const secp256k1_scalar* r, const secp256k1_scalar* s, const secp256k1_ge *pubkey, const secp256k1_scalar *message); 19 | static int secp256k1_ecdsa_sig_sign(const secp256k1_ecmult_gen_context *ctx, secp256k1_scalar* r, secp256k1_scalar* s, const secp256k1_scalar *seckey, const secp256k1_scalar *message, const secp256k1_scalar *nonce, int *recid); 20 | 21 | #endif /* SECP256K1_ECDSA_H */ 22 | -------------------------------------------------------------------------------- /external/secp256k1/src/eckey.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or https://www.opensource.org/licenses/mit-license.php.* 5 | ***********************************************************************/ 6 | 7 | #ifndef SECP256K1_ECKEY_H 8 | #define SECP256K1_ECKEY_H 9 | 10 | #include 11 | 12 | #include "group.h" 13 | #include "scalar.h" 14 | #include "ecmult.h" 15 | #include "ecmult_gen.h" 16 | 17 | static int secp256k1_eckey_pubkey_parse(secp256k1_ge *elem, const unsigned char *pub, size_t size); 18 | static int secp256k1_eckey_pubkey_serialize(secp256k1_ge *elem, unsigned char *pub, size_t *size, int compressed); 19 | 20 | static int secp256k1_eckey_privkey_tweak_add(secp256k1_scalar *key, const secp256k1_scalar *tweak); 21 | static int secp256k1_eckey_pubkey_tweak_add(secp256k1_ge *key, const secp256k1_scalar *tweak); 22 | static int secp256k1_eckey_privkey_tweak_mul(secp256k1_scalar *key, const secp256k1_scalar *tweak); 23 | static int secp256k1_eckey_pubkey_tweak_mul(secp256k1_ge *key, const secp256k1_scalar *tweak); 24 | 25 | #endif /* SECP256K1_ECKEY_H */ 26 | -------------------------------------------------------------------------------- /external/secp256k1/src/ecmult_compute_table.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************************************** 2 | * Copyright (c) 2013, 2014, 2017, 2021 Pieter Wuille, Andrew Poelstra, Jonas Nick, Russell O'Connor * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or https://www.opensource.org/licenses/mit-license.php. * 5 | *****************************************************************************************************/ 6 | 7 | #ifndef SECP256K1_ECMULT_COMPUTE_TABLE_H 8 | #define SECP256K1_ECMULT_COMPUTE_TABLE_H 9 | 10 | /* Construct table of all odd multiples of gen in range 1..(2**(window_g-1)-1). */ 11 | static void secp256k1_ecmult_compute_table(secp256k1_ge_storage* table, int window_g, const secp256k1_gej* gen); 12 | 13 | /* Like secp256k1_ecmult_compute_table, but one for both gen and gen*2^128. */ 14 | static void secp256k1_ecmult_compute_two_tables(secp256k1_ge_storage* table, secp256k1_ge_storage* table_128, int window_g, const secp256k1_ge* gen); 15 | 16 | #endif /* SECP256K1_ECMULT_COMPUTE_TABLE_H */ 17 | -------------------------------------------------------------------------------- /external/secp256k1/src/ecmult_const.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Copyright (c) 2015 Andrew Poelstra * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or https://www.opensource.org/licenses/mit-license.php.* 5 | ***********************************************************************/ 6 | 7 | #ifndef SECP256K1_ECMULT_CONST_H 8 | #define SECP256K1_ECMULT_CONST_H 9 | 10 | #include "scalar.h" 11 | #include "group.h" 12 | 13 | /** 14 | * Multiply: R = q*A (in constant-time for q) 15 | */ 16 | static void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge *a, const secp256k1_scalar *q); 17 | 18 | /** 19 | * Same as secp256k1_ecmult_const, but takes in an x coordinate of the base point 20 | * only, specified as fraction n/d (numerator/denominator). Only the x coordinate of the result is 21 | * returned. 22 | * 23 | * If known_on_curve is 0, a verification is performed that n/d is a valid X 24 | * coordinate, and 0 is returned if not. Otherwise, 1 is returned. 25 | * 26 | * d being NULL is interpreted as d=1. If non-NULL, d must not be zero. q must not be zero. 27 | * 28 | * Constant time in the value of q, but not any other inputs. 29 | */ 30 | static int secp256k1_ecmult_const_xonly( 31 | secp256k1_fe *r, 32 | const secp256k1_fe *n, 33 | const secp256k1_fe *d, 34 | const secp256k1_scalar *q, 35 | int known_on_curve 36 | ); 37 | 38 | #endif /* SECP256K1_ECMULT_CONST_H */ 39 | -------------------------------------------------------------------------------- /external/secp256k1/src/ecmult_gen_compute_table.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Copyright (c) Pieter Wuille, Gregory Maxwell * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or https://www.opensource.org/licenses/mit-license.php.* 5 | ***********************************************************************/ 6 | 7 | #ifndef SECP256K1_ECMULT_GEN_COMPUTE_TABLE_H 8 | #define SECP256K1_ECMULT_GEN_COMPUTE_TABLE_H 9 | 10 | #include "ecmult_gen.h" 11 | 12 | static void secp256k1_ecmult_gen_compute_table(secp256k1_ge_storage* table, const secp256k1_ge* gen, int blocks, int teeth, int spacing); 13 | 14 | #endif /* SECP256K1_ECMULT_GEN_COMPUTE_TABLE_H */ 15 | -------------------------------------------------------------------------------- /external/secp256k1/src/int128_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef SECP256K1_INT128_IMPL_H 2 | #define SECP256K1_INT128_IMPL_H 3 | 4 | #include "util.h" 5 | 6 | #include "int128.h" 7 | 8 | #if defined(SECP256K1_WIDEMUL_INT128) 9 | # if defined(SECP256K1_INT128_NATIVE) 10 | # include "int128_native_impl.h" 11 | # elif defined(SECP256K1_INT128_STRUCT) 12 | # include "int128_struct_impl.h" 13 | # else 14 | # error "Please select int128 implementation" 15 | # endif 16 | #endif 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /external/secp256k1/src/int128_native.h: -------------------------------------------------------------------------------- 1 | #ifndef SECP256K1_INT128_NATIVE_H 2 | #define SECP256K1_INT128_NATIVE_H 3 | 4 | #include 5 | #include "util.h" 6 | 7 | #if !defined(UINT128_MAX) && defined(__SIZEOF_INT128__) 8 | SECP256K1_GNUC_EXT typedef unsigned __int128 uint128_t; 9 | SECP256K1_GNUC_EXT typedef __int128 int128_t; 10 | # define UINT128_MAX ((uint128_t)(-1)) 11 | # define INT128_MAX ((int128_t)(UINT128_MAX >> 1)) 12 | # define INT128_MIN (-INT128_MAX - 1) 13 | /* No (U)INT128_C macros because compilers providing __int128 do not support 128-bit literals. */ 14 | #endif 15 | 16 | typedef uint128_t secp256k1_uint128; 17 | typedef int128_t secp256k1_int128; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /external/secp256k1/src/int128_struct.h: -------------------------------------------------------------------------------- 1 | #ifndef SECP256K1_INT128_STRUCT_H 2 | #define SECP256K1_INT128_STRUCT_H 3 | 4 | #include 5 | #include "util.h" 6 | 7 | typedef struct { 8 | uint64_t lo; 9 | uint64_t hi; 10 | } secp256k1_uint128; 11 | 12 | typedef secp256k1_uint128 secp256k1_int128; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /external/secp256k1/src/modules/ecdh/Makefile.am.include: -------------------------------------------------------------------------------- 1 | include_HEADERS += include/secp256k1_ecdh.h 2 | noinst_HEADERS += src/modules/ecdh/main_impl.h 3 | noinst_HEADERS += src/modules/ecdh/tests_impl.h 4 | noinst_HEADERS += src/modules/ecdh/bench_impl.h 5 | -------------------------------------------------------------------------------- /external/secp256k1/src/modules/ellswift/Makefile.am.include: -------------------------------------------------------------------------------- 1 | include_HEADERS += include/secp256k1_ellswift.h 2 | noinst_HEADERS += src/modules/ellswift/bench_impl.h 3 | noinst_HEADERS += src/modules/ellswift/main_impl.h 4 | noinst_HEADERS += src/modules/ellswift/tests_impl.h 5 | noinst_HEADERS += src/modules/ellswift/tests_exhaustive_impl.h 6 | -------------------------------------------------------------------------------- /external/secp256k1/src/modules/extrakeys/Makefile.am.include: -------------------------------------------------------------------------------- 1 | include_HEADERS += include/secp256k1_extrakeys.h 2 | noinst_HEADERS += src/modules/extrakeys/tests_impl.h 3 | noinst_HEADERS += src/modules/extrakeys/tests_exhaustive_impl.h 4 | noinst_HEADERS += src/modules/extrakeys/main_impl.h 5 | -------------------------------------------------------------------------------- /external/secp256k1/src/modules/musig/Makefile.am.include: -------------------------------------------------------------------------------- 1 | include_HEADERS += include/secp256k1_musig.h 2 | noinst_HEADERS += src/modules/musig/main_impl.h 3 | noinst_HEADERS += src/modules/musig/keyagg.h 4 | noinst_HEADERS += src/modules/musig/keyagg_impl.h 5 | noinst_HEADERS += src/modules/musig/session.h 6 | noinst_HEADERS += src/modules/musig/session_impl.h 7 | noinst_HEADERS += src/modules/musig/tests_impl.h 8 | noinst_HEADERS += src/modules/musig/vectors.h 9 | -------------------------------------------------------------------------------- /external/secp256k1/src/modules/musig/keyagg.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Distributed under the MIT software license, see the accompanying * 3 | * file COPYING or https://www.opensource.org/licenses/mit-license.php.* 4 | ***********************************************************************/ 5 | 6 | #ifndef SECP256K1_MODULE_MUSIG_KEYAGG_H 7 | #define SECP256K1_MODULE_MUSIG_KEYAGG_H 8 | 9 | #include "../../../include/secp256k1.h" 10 | #include "../../../include/secp256k1_musig.h" 11 | 12 | #include "../../group.h" 13 | #include "../../scalar.h" 14 | 15 | typedef struct { 16 | secp256k1_ge pk; 17 | /* If there is no "second" public key, second_pk is set to the point at 18 | * infinity */ 19 | secp256k1_ge second_pk; 20 | unsigned char pks_hash[32]; 21 | /* tweak is identical to value tacc[v] in the specification. */ 22 | secp256k1_scalar tweak; 23 | /* parity_acc corresponds to (1 - gacc[v])/2 in the spec. So if gacc[v] is 24 | * -1, parity_acc is 1. Otherwise, parity_acc is 0. */ 25 | int parity_acc; 26 | } secp256k1_keyagg_cache_internal; 27 | 28 | static int secp256k1_keyagg_cache_load(const secp256k1_context* ctx, secp256k1_keyagg_cache_internal *cache_i, const secp256k1_musig_keyagg_cache *cache); 29 | 30 | static void secp256k1_musig_keyaggcoef(secp256k1_scalar *r, const secp256k1_keyagg_cache_internal *cache_i, secp256k1_ge *pk); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /external/secp256k1/src/modules/musig/main_impl.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Distributed under the MIT software license, see the accompanying * 3 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 4 | **********************************************************************/ 5 | 6 | #ifndef SECP256K1_MODULE_MUSIG_MAIN_H 7 | #define SECP256K1_MODULE_MUSIG_MAIN_H 8 | 9 | #include "keyagg_impl.h" 10 | #include "session_impl.h" 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /external/secp256k1/src/modules/musig/session.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Distributed under the MIT software license, see the accompanying * 3 | * file COPYING or https://www.opensource.org/licenses/mit-license.php.* 4 | ***********************************************************************/ 5 | 6 | #ifndef SECP256K1_MODULE_MUSIG_SESSION_H 7 | #define SECP256K1_MODULE_MUSIG_SESSION_H 8 | 9 | #include "../../../include/secp256k1.h" 10 | #include "../../../include/secp256k1_musig.h" 11 | 12 | #include "../../scalar.h" 13 | 14 | typedef struct { 15 | int fin_nonce_parity; 16 | unsigned char fin_nonce[32]; 17 | secp256k1_scalar noncecoef; 18 | secp256k1_scalar challenge; 19 | secp256k1_scalar s_part; 20 | } secp256k1_musig_session_internal; 21 | 22 | static int secp256k1_musig_session_load(const secp256k1_context* ctx, secp256k1_musig_session_internal *session_i, const secp256k1_musig_session *session); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /external/secp256k1/src/modules/recovery/Makefile.am.include: -------------------------------------------------------------------------------- 1 | include_HEADERS += include/secp256k1_recovery.h 2 | noinst_HEADERS += src/modules/recovery/main_impl.h 3 | noinst_HEADERS += src/modules/recovery/tests_impl.h 4 | noinst_HEADERS += src/modules/recovery/tests_exhaustive_impl.h 5 | noinst_HEADERS += src/modules/recovery/bench_impl.h 6 | -------------------------------------------------------------------------------- /external/secp256k1/src/modules/schnorrsig/Makefile.am.include: -------------------------------------------------------------------------------- 1 | include_HEADERS += include/secp256k1_schnorrsig.h 2 | noinst_HEADERS += src/modules/schnorrsig/main_impl.h 3 | noinst_HEADERS += src/modules/schnorrsig/tests_impl.h 4 | noinst_HEADERS += src/modules/schnorrsig/tests_exhaustive_impl.h 5 | noinst_HEADERS += src/modules/schnorrsig/bench_impl.h 6 | -------------------------------------------------------------------------------- /external/secp256k1/src/precomputed_ecmult.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************************************** 2 | * Copyright (c) 2013, 2014, 2017, 2021 Pieter Wuille, Andrew Poelstra, Jonas Nick, Russell O'Connor * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or https://www.opensource.org/licenses/mit-license.php. * 5 | *****************************************************************************************************/ 6 | 7 | #ifndef SECP256K1_PRECOMPUTED_ECMULT_H 8 | #define SECP256K1_PRECOMPUTED_ECMULT_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "ecmult.h" 15 | #include "group.h" 16 | #if defined(EXHAUSTIVE_TEST_ORDER) 17 | # if EXHAUSTIVE_TEST_ORDER == 7 18 | # define WINDOW_G 3 19 | # elif EXHAUSTIVE_TEST_ORDER == 13 20 | # define WINDOW_G 4 21 | # elif EXHAUSTIVE_TEST_ORDER == 199 22 | # define WINDOW_G 8 23 | # else 24 | # error No known generator for the specified exhaustive test group order. 25 | # endif 26 | static secp256k1_ge_storage secp256k1_pre_g[ECMULT_TABLE_SIZE(WINDOW_G)]; 27 | static secp256k1_ge_storage secp256k1_pre_g_128[ECMULT_TABLE_SIZE(WINDOW_G)]; 28 | #else /* !defined(EXHAUSTIVE_TEST_ORDER) */ 29 | # define WINDOW_G ECMULT_WINDOW_SIZE 30 | extern const secp256k1_ge_storage secp256k1_pre_g[ECMULT_TABLE_SIZE(WINDOW_G)]; 31 | extern const secp256k1_ge_storage secp256k1_pre_g_128[ECMULT_TABLE_SIZE(WINDOW_G)]; 32 | #endif /* defined(EXHAUSTIVE_TEST_ORDER) */ 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* SECP256K1_PRECOMPUTED_ECMULT_H */ 39 | -------------------------------------------------------------------------------- /external/secp256k1/src/precomputed_ecmult_gen.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | * Copyright (c) 2013, 2014, 2015, 2021 Thomas Daede, Cory Fields, Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or https://www.opensource.org/licenses/mit-license.php. * 5 | *********************************************************************************/ 6 | 7 | #ifndef SECP256K1_PRECOMPUTED_ECMULT_GEN_H 8 | #define SECP256K1_PRECOMPUTED_ECMULT_GEN_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "group.h" 15 | #include "ecmult_gen.h" 16 | #ifdef EXHAUSTIVE_TEST_ORDER 17 | static secp256k1_ge_storage secp256k1_ecmult_gen_prec_table[COMB_BLOCKS][COMB_POINTS]; 18 | #else 19 | extern const secp256k1_ge_storage secp256k1_ecmult_gen_prec_table[COMB_BLOCKS][COMB_POINTS]; 20 | #endif /* defined(EXHAUSTIVE_TEST_ORDER) */ 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif /* SECP256K1_PRECOMPUTED_ECMULT_GEN_H */ 27 | -------------------------------------------------------------------------------- /external/secp256k1/src/scalar_4x64.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Copyright (c) 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or https://www.opensource.org/licenses/mit-license.php.* 5 | ***********************************************************************/ 6 | 7 | #ifndef SECP256K1_SCALAR_REPR_H 8 | #define SECP256K1_SCALAR_REPR_H 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef struct { 14 | uint64_t d[4]; 15 | } secp256k1_scalar; 16 | 17 | #define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{((uint64_t)(d1)) << 32 | (d0), ((uint64_t)(d3)) << 32 | (d2), ((uint64_t)(d5)) << 32 | (d4), ((uint64_t)(d7)) << 32 | (d6)}} 18 | 19 | #endif /* SECP256K1_SCALAR_REPR_H */ 20 | -------------------------------------------------------------------------------- /external/secp256k1/src/scalar_8x32.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Copyright (c) 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or https://www.opensource.org/licenses/mit-license.php.* 5 | ***********************************************************************/ 6 | 7 | #ifndef SECP256K1_SCALAR_REPR_H 8 | #define SECP256K1_SCALAR_REPR_H 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef struct { 14 | uint32_t d[8]; 15 | } secp256k1_scalar; 16 | 17 | #define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7)}} 18 | 19 | #endif /* SECP256K1_SCALAR_REPR_H */ 20 | -------------------------------------------------------------------------------- /external/secp256k1/src/scalar_low.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Copyright (c) 2015, 2022 Andrew Poelstra, Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or https://www.opensource.org/licenses/mit-license.php.* 5 | ***********************************************************************/ 6 | 7 | #ifndef SECP256K1_SCALAR_REPR_H 8 | #define SECP256K1_SCALAR_REPR_H 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef uint32_t secp256k1_scalar; 14 | 15 | /* A compile-time constant equal to 2^32 (modulo order). */ 16 | #define SCALAR_2P32 ((0xffffffffUL % EXHAUSTIVE_TEST_ORDER) + 1U) 17 | 18 | /* Compute a*2^32 + b (modulo order). */ 19 | #define SCALAR_HORNER(a, b) (((uint64_t)(a) * SCALAR_2P32 + (b)) % EXHAUSTIVE_TEST_ORDER) 20 | 21 | /* Evaluates to the provided 256-bit constant reduced modulo order. */ 22 | #define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) SCALAR_HORNER(SCALAR_HORNER(SCALAR_HORNER(SCALAR_HORNER(SCALAR_HORNER(SCALAR_HORNER(SCALAR_HORNER((d7), (d6)), (d5)), (d4)), (d3)), (d2)), (d1)), (d0)) 23 | 24 | #endif /* SECP256K1_SCALAR_REPR_H */ 25 | -------------------------------------------------------------------------------- /external/secp256k1/src/selftest.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Copyright (c) 2020 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or https://www.opensource.org/licenses/mit-license.php.* 5 | ***********************************************************************/ 6 | 7 | #ifndef SECP256K1_SELFTEST_H 8 | #define SECP256K1_SELFTEST_H 9 | 10 | #include "hash.h" 11 | 12 | #include 13 | 14 | static int secp256k1_selftest_sha256(void) { 15 | static const char *input63 = "For this sample, this 63-byte string will be used as input data"; 16 | static const unsigned char output32[32] = { 17 | 0xf0, 0x8a, 0x78, 0xcb, 0xba, 0xee, 0x08, 0x2b, 0x05, 0x2a, 0xe0, 0x70, 0x8f, 0x32, 0xfa, 0x1e, 18 | 0x50, 0xc5, 0xc4, 0x21, 0xaa, 0x77, 0x2b, 0xa5, 0xdb, 0xb4, 0x06, 0xa2, 0xea, 0x6b, 0xe3, 0x42, 19 | }; 20 | unsigned char out[32]; 21 | secp256k1_sha256 hasher; 22 | secp256k1_sha256_initialize(&hasher); 23 | secp256k1_sha256_write(&hasher, (const unsigned char*)input63, 63); 24 | secp256k1_sha256_finalize(&hasher, out); 25 | return secp256k1_memcmp_var(out, output32, 32) == 0; 26 | } 27 | 28 | static int secp256k1_selftest_passes(void) { 29 | return secp256k1_selftest_sha256(); 30 | } 31 | 32 | #endif /* SECP256K1_SELFTEST_H */ 33 | -------------------------------------------------------------------------------- /external/snappy/patches/1.1.10-0001-fix-inlining-failure.patch: -------------------------------------------------------------------------------- 1 | diff --git a/snappy-stubs-internal.h b/snappy-stubs-internal.h 2 | index 1548ed7..3b4a9f3 100644 3 | --- a/snappy-stubs-internal.h 4 | +++ b/snappy-stubs-internal.h 5 | @@ -100,7 +100,7 @@ 6 | 7 | // Inlining hints. 8 | #if HAVE_ATTRIBUTE_ALWAYS_INLINE 9 | -#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline)) 10 | +#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE 11 | #else 12 | #define SNAPPY_ATTRIBUTE_ALWAYS_INLINE 13 | #endif // HAVE_ATTRIBUTE_ALWAYS_INLINE 14 | -------------------------------------------------------------------------------- /external/snappy/patches/1.1.10-0003-fix-clobber-list-older-llvm.patch: -------------------------------------------------------------------------------- 1 | diff --git a/snappy.cc b/snappy.cc 2 | index d414718..e4efb59 100644 3 | --- a/snappy.cc 4 | +++ b/snappy.cc 5 | @@ -1132,7 +1132,7 @@ inline size_t AdvanceToNextTagX86Optimized(const uint8_t** ip_p, size_t* tag) { 6 | size_t literal_len = *tag >> 2; 7 | size_t tag_type = *tag; 8 | bool is_literal; 9 | -#if defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(__x86_64__) 10 | +#if defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(__x86_64__) && ( (!defined(__clang__) && !defined(__APPLE__)) || (!defined(__APPLE__) && defined(__clang__) && (__clang_major__ >= 9)) || (defined(__APPLE__) && defined(__clang__) && (__clang_major__ > 11)) ) 11 | // TODO clang misses the fact that the (c & 3) already correctly 12 | // sets the zero flag. 13 | asm("and $3, %k[tag_type]\n\t" 14 | -------------------------------------------------------------------------------- /external/snappy/patches/1.1.9-0001-fix-inlining-failure.patch: -------------------------------------------------------------------------------- 1 | Fixes the following error: 2 | error: inlining failed in call to ‘always_inline’ ‘size_t snappy::AdvanceToNextTag(const uint8_t**, size_t*)’: function body can be overwritten at link time 3 | 4 | --- snappy-stubs-internal.h 5 | +++ snappy-stubs-internal.h 6 | @@ -100,7 +100,7 @@ 7 | 8 | // Inlining hints. 9 | #ifdef HAVE_ATTRIBUTE_ALWAYS_INLINE 10 | -#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline)) 11 | +#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE 12 | #else 13 | #define SNAPPY_ATTRIBUTE_ALWAYS_INLINE 14 | #endif 15 | -------------------------------------------------------------------------------- /external/snappy/patches/1.1.9-0002-no-Werror.patch: -------------------------------------------------------------------------------- 1 | --- CMakeLists.txt 2 | +++ CMakeLists.txt 3 | @@ -69,7 +69,7 @@ 4 | - # Use -Werror for clang only. 5 | +if(0) 6 | if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") 7 | if(NOT CMAKE_CXX_FLAGS MATCHES "-Werror") 8 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") 9 | endif(NOT CMAKE_CXX_FLAGS MATCHES "-Werror") 10 | endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") 11 | - 12 | +endif() 13 | -------------------------------------------------------------------------------- /external/snappy/patches/1.1.9-0003-fix-clobber-list-older-llvm.patch: -------------------------------------------------------------------------------- 1 | asm clobbers do not work for clang < 9 and apple-clang < 11 (found by SpaceIm) 2 | --- snappy.cc 3 | +++ snappy.cc 4 | @@ -1026,7 +1026,7 @@ 5 | size_t literal_len = *tag >> 2; 6 | size_t tag_type = *tag; 7 | bool is_literal; 8 | -#if defined(__GNUC__) && defined(__x86_64__) 9 | +#if defined(__GNUC__) && defined(__x86_64__) && ( (!defined(__clang__) && !defined(__APPLE__)) || (!defined(__APPLE__) && defined(__clang__) && (__clang_major__ >= 9)) || (defined(__APPLE__) && defined(__clang__) && (__clang_major__ > 11)) ) 10 | // TODO clang misses the fact that the (c & 3) already correctly 11 | // sets the zero flag. 12 | asm("and $3, %k[tag_type]\n\t" 13 | -------------------------------------------------------------------------------- /external/snappy/patches/1.1.9-0004-rtti-by-default.patch: -------------------------------------------------------------------------------- 1 | --- a/CMakeLists.txt 2 | +++ b/CMakeLists.txt 3 | @@ -53,8 +53,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") 4 | add_definitions(-D_HAS_EXCEPTIONS=0) 5 | 6 | # Disable RTTI. 7 | - string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") 8 | - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") 9 | else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") 10 | # Use -Wall for clang and gcc. 11 | if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall") 12 | @@ -78,8 +76,6 @@ endif() 13 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") 14 | 15 | # Disable RTTI. 16 | - string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") 17 | - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") 18 | endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") 19 | 20 | # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make 21 | -------------------------------------------------------------------------------- /external/soci/conandata.yml: -------------------------------------------------------------------------------- 1 | sources: 2 | "4.0.3": 3 | url: "https://github.com/SOCI/soci/archive/v4.0.3.tar.gz" 4 | sha256: "4b1ff9c8545c5d802fbe06ee6cd2886630e5c03bf740e269bb625b45cf934928" 5 | patches: 6 | "4.0.3": 7 | - patch_file: "patches/0001-Remove-hardcoded-INSTALL_NAME_DIR-for-relocatable-li.patch" 8 | patch_description: "Generate relocatable libraries on MacOS" 9 | patch_type: "portability" 10 | - patch_file: "patches/0002-Fix-soci_backend.patch" 11 | patch_description: "Fix variable names for dependencies" 12 | patch_type: "conan" 13 | -------------------------------------------------------------------------------- /external/soci/patches/0001-Remove-hardcoded-INSTALL_NAME_DIR-for-relocatable-li.patch: -------------------------------------------------------------------------------- 1 | From d491bf7b5040d314ffd0c6310ba01f78ff44c85e Mon Sep 17 00:00:00 2001 2 | From: Rasmus Thomsen 3 | Date: Fri, 14 Apr 2023 09:16:29 +0200 4 | Subject: [PATCH] Remove hardcoded INSTALL_NAME_DIR for relocatable libraries 5 | on MacOS 6 | 7 | --- 8 | cmake/SociBackend.cmake | 2 +- 9 | src/core/CMakeLists.txt | 1 - 10 | 2 files changed, 1 insertion(+), 2 deletions(-) 11 | 12 | diff --git a/cmake/SociBackend.cmake b/cmake/SociBackend.cmake 13 | index 5d4ef0df..39fe1f77 100644 14 | --- a/cmake/SociBackend.cmake 15 | +++ b/cmake/SociBackend.cmake 16 | @@ -171,7 +171,7 @@ macro(soci_backend NAME) 17 | set_target_properties(${THIS_BACKEND_TARGET} 18 | PROPERTIES 19 | SOVERSION ${${PROJECT_NAME}_SOVERSION} 20 | - INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib) 21 | + ) 22 | 23 | if(APPLE) 24 | set_target_properties(${THIS_BACKEND_TARGET} 25 | diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt 26 | index 3e7deeae..f9eae564 100644 27 | --- a/src/core/CMakeLists.txt 28 | +++ b/src/core/CMakeLists.txt 29 | @@ -59,7 +59,6 @@ if (SOCI_SHARED) 30 | PROPERTIES 31 | VERSION ${SOCI_VERSION} 32 | SOVERSION ${SOCI_SOVERSION} 33 | - INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib 34 | CLEAN_DIRECT_OUTPUT 1) 35 | endif() 36 | 37 | -- 38 | 2.25.1 39 | 40 | -------------------------------------------------------------------------------- /external/soci/patches/0002-Fix-soci_backend.patch: -------------------------------------------------------------------------------- 1 | diff --git a/cmake/SociBackend.cmake b/cmake/SociBackend.cmake 2 | index 0a664667..3fa2ed95 100644 3 | --- a/cmake/SociBackend.cmake 4 | +++ b/cmake/SociBackend.cmake 5 | @@ -31,14 +31,13 @@ macro(soci_backend_deps_found NAME DEPS SUCCESS) 6 | if(NOT DEPEND_FOUND) 7 | list(APPEND DEPS_NOT_FOUND ${dep}) 8 | else() 9 | - string(TOUPPER "${dep}" DEPU) 10 | - if( ${DEPU}_INCLUDE_DIR ) 11 | - list(APPEND DEPS_INCLUDE_DIRS ${${DEPU}_INCLUDE_DIR}) 12 | + if( ${dep}_INCLUDE_DIR ) 13 | + list(APPEND DEPS_INCLUDE_DIRS ${${dep}_INCLUDE_DIR}) 14 | endif() 15 | - if( ${DEPU}_INCLUDE_DIRS ) 16 | - list(APPEND DEPS_INCLUDE_DIRS ${${DEPU}_INCLUDE_DIRS}) 17 | + if( ${dep}_INCLUDE_DIRS ) 18 | + list(APPEND DEPS_INCLUDE_DIRS ${${dep}_INCLUDE_DIRS}) 19 | endif() 20 | - list(APPEND DEPS_LIBRARIES ${${DEPU}_LIBRARIES}) 21 | + list(APPEND DEPS_LIBRARIES ${${dep}_LIBRARIES}) 22 | endif() 23 | endforeach() 24 | 25 | -------------------------------------------------------------------------------- /include/xrpl/basics/Archive.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2018 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_BASICS_ARCHIVE_H_INCLUDED 21 | #define RIPPLE_BASICS_ARCHIVE_H_INCLUDED 22 | 23 | #include 24 | 25 | namespace ripple { 26 | 27 | /** Extract a tar archive compressed with lz4 28 | 29 | @param src the path of the archive to be extracted 30 | @param dst the directory to extract to 31 | 32 | @throws runtime_error 33 | */ 34 | void 35 | extractTarLz4( 36 | boost::filesystem::path const& src, 37 | boost::filesystem::path const& dst); 38 | 39 | } // namespace ripple 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /include/xrpl/basics/Blob.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_BASICS_BLOB_H_INCLUDED 21 | #define RIPPLE_BASICS_BLOB_H_INCLUDED 22 | 23 | #include 24 | 25 | namespace ripple { 26 | 27 | /** Storage for linear binary data. 28 | Blocks of binary data appear often in various idioms and structures. 29 | */ 30 | using Blob = std::vector; 31 | 32 | } // namespace ripple 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /include/xrpl/basics/ByteUtilities.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2018 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_BASICS_BYTEUTILITIES_H_INCLUDED 21 | #define RIPPLE_BASICS_BYTEUTILITIES_H_INCLUDED 22 | 23 | namespace ripple { 24 | 25 | template 26 | constexpr auto 27 | kilobytes(T value) noexcept 28 | { 29 | return value * 1024; 30 | } 31 | 32 | template 33 | constexpr auto 34 | megabytes(T value) noexcept 35 | { 36 | return kilobytes(kilobytes(value)); 37 | } 38 | 39 | static_assert(kilobytes(2) == 2048, "kilobytes(2) == 2048"); 40 | static_assert(megabytes(3) == 3145728, "megabytes(3) == 3145728"); 41 | } // namespace ripple 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /include/xrpl/basics/KeyCache.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2021 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_BASICS_KEYCACHE_H 21 | #define RIPPLE_BASICS_KEYCACHE_H 22 | 23 | #include 24 | #include 25 | 26 | namespace ripple { 27 | 28 | using KeyCache = TaggedCache; 29 | 30 | } // namespace ripple 31 | 32 | #endif // RIPPLE_BASICS_KEYCACHE_H 33 | -------------------------------------------------------------------------------- /include/xrpl/basics/README.md: -------------------------------------------------------------------------------- 1 | # Basics 2 | 3 | Utility functions and classes. 4 | 5 | ripple/basic should contain no dependencies on other modules. 6 | 7 | 8 | Choosing a rippled container. 9 | ============================= 10 | 11 | * `std::vector` 12 | * For ordered containers with most insertions or erases at the end. 13 | 14 | * `std::deque` 15 | * For ordered containers with most insertions or erases at the start or end. 16 | 17 | * `std::list` 18 | * For ordered containers with inserts and erases to the middle. 19 | * For containers with iterators stable over insert and erase. 20 | * Generally slower and bigger than `std::vector` or `std::deque` except for 21 | those cases. 22 | 23 | * `std::set` 24 | * For sorted containers. 25 | 26 | * `ripple::hash_set` 27 | * Where inserts and contains need to be O(1). 28 | * For "small" sets, `std::set` might be faster and smaller. 29 | 30 | * `ripple::hardened_hash_set` 31 | * For data sets where the key could be manipulated by an attacker 32 | in an attempt to mount an algorithmic complexity attack: see 33 | http://en.wikipedia.org/wiki/Algorithmic_complexity_attack 34 | 35 | 36 | The following container is deprecated 37 | 38 | * `std::unordered_set` 39 | * Use `ripple::hash_set` instead, which uses a better hashing algorithm. 40 | * Or use `ripple::hardened_hash_set` to prevent algorithmic complexity attacks. 41 | -------------------------------------------------------------------------------- /include/xrpl/basics/ResolverAsio.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_BASICS_RESOLVERASIO_H_INCLUDED 21 | #define RIPPLE_BASICS_RESOLVERASIO_H_INCLUDED 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | namespace ripple { 29 | 30 | class ResolverAsio : public Resolver 31 | { 32 | public: 33 | explicit ResolverAsio() = default; 34 | 35 | static std::unique_ptr 36 | New(boost::asio::io_service&, beast::Journal); 37 | }; 38 | 39 | } // namespace ripple 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /include/xrpl/beast/container/aged_container.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of Beast: https://github.com/vinniefalco/Beast 4 | Copyright 2013, Vinnie Falco 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef BEAST_CONTAINER_AGED_CONTAINER_H_INCLUDED 21 | #define BEAST_CONTAINER_AGED_CONTAINER_H_INCLUDED 22 | 23 | #include 24 | 25 | namespace beast { 26 | 27 | template 28 | struct is_aged_container : std::false_type 29 | { 30 | explicit is_aged_container() = default; 31 | }; 32 | 33 | } // namespace beast 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /include/xrpl/beast/insight/CounterImpl.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of Beast: https://github.com/vinniefalco/Beast 4 | Copyright 2013, Vinnie Falco 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef BEAST_INSIGHT_COUNTERIMPL_H_INCLUDED 21 | #define BEAST_INSIGHT_COUNTERIMPL_H_INCLUDED 22 | 23 | #include 24 | #include 25 | 26 | namespace beast { 27 | namespace insight { 28 | 29 | class Counter; 30 | 31 | class CounterImpl : public std::enable_shared_from_this 32 | { 33 | public: 34 | using value_type = std::int64_t; 35 | 36 | virtual ~CounterImpl() = 0; 37 | virtual void 38 | increment(value_type amount) = 0; 39 | }; 40 | 41 | } // namespace insight 42 | } // namespace beast 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /include/xrpl/beast/insight/EventImpl.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of Beast: https://github.com/vinniefalco/Beast 4 | Copyright 2013, Vinnie Falco 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef BEAST_INSIGHT_EVENTIMPL_H_INCLUDED 21 | #define BEAST_INSIGHT_EVENTIMPL_H_INCLUDED 22 | 23 | #include 24 | #include 25 | 26 | namespace beast { 27 | namespace insight { 28 | 29 | class Event; 30 | 31 | class EventImpl : public std::enable_shared_from_this 32 | { 33 | public: 34 | using value_type = std::chrono::milliseconds; 35 | 36 | virtual ~EventImpl() = 0; 37 | virtual void 38 | notify(value_type const& value) = 0; 39 | }; 40 | 41 | } // namespace insight 42 | } // namespace beast 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /include/xrpl/beast/insight/HookImpl.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of Beast: https://github.com/vinniefalco/Beast 4 | Copyright 2013, Vinnie Falco 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef BEAST_INSIGHT_HOOKIMPL_H_INCLUDED 21 | #define BEAST_INSIGHT_HOOKIMPL_H_INCLUDED 22 | 23 | #include 24 | #include 25 | 26 | namespace beast { 27 | namespace insight { 28 | 29 | class HookImpl : public std::enable_shared_from_this 30 | { 31 | public: 32 | using HandlerType = std::function; 33 | 34 | virtual ~HookImpl() = 0; 35 | }; 36 | 37 | } // namespace insight 38 | } // namespace beast 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /include/xrpl/beast/insight/MeterImpl.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of Beast: https://github.com/vinniefalco/Beast 4 | Copyright 2013, Vinnie Falco 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef BEAST_INSIGHT_METERIMPL_H_INCLUDED 21 | #define BEAST_INSIGHT_METERIMPL_H_INCLUDED 22 | 23 | #include 24 | #include 25 | 26 | namespace beast { 27 | namespace insight { 28 | 29 | class Meter; 30 | 31 | class MeterImpl : public std::enable_shared_from_this 32 | { 33 | public: 34 | using value_type = std::uint64_t; 35 | 36 | virtual ~MeterImpl() = 0; 37 | virtual void 38 | increment(value_type amount) = 0; 39 | }; 40 | 41 | } // namespace insight 42 | } // namespace beast 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /include/xrpl/beast/insight/NullCollector.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of Beast: https://github.com/vinniefalco/Beast 4 | Copyright 2013, Vinnie Falco 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef BEAST_INSIGHT_NULLCOLLECTOR_H_INCLUDED 21 | #define BEAST_INSIGHT_NULLCOLLECTOR_H_INCLUDED 22 | 23 | #include 24 | 25 | namespace beast { 26 | namespace insight { 27 | 28 | /** A Collector which does not collect metrics. */ 29 | class NullCollector : public Collector 30 | { 31 | public: 32 | explicit NullCollector() = default; 33 | 34 | static std::shared_ptr 35 | New(); 36 | }; 37 | 38 | } // namespace insight 39 | } // namespace beast 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /include/xrpl/beast/unit_test/amount.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | 8 | #ifndef BEAST_UNIT_TEST_AMOUNT_HPP 9 | #define BEAST_UNIT_TEST_AMOUNT_HPP 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | namespace beast { 16 | namespace unit_test { 17 | 18 | /** Utility for producing nicely composed output of amounts with units. */ 19 | class amount 20 | { 21 | private: 22 | std::size_t n_; 23 | std::string const& what_; 24 | 25 | public: 26 | amount(amount const&) = default; 27 | amount& 28 | operator=(amount const&) = delete; 29 | 30 | template 31 | amount(std::size_t n, std::string const& what); 32 | 33 | friend std::ostream& 34 | operator<<(std::ostream& s, amount const& t); 35 | }; 36 | 37 | template 38 | amount::amount(std::size_t n, std::string const& what) : n_(n), what_(what) 39 | { 40 | } 41 | 42 | inline std::ostream& 43 | operator<<(std::ostream& s, amount const& t) 44 | { 45 | s << t.n_ << " " << t.what_ << ((t.n_ != 1) ? "s" : ""); 46 | return s; 47 | } 48 | 49 | } // namespace unit_test 50 | } // namespace beast 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /include/xrpl/beast/unit_test/global_suites.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | 8 | #ifndef BEAST_UNIT_TEST_GLOBAL_SUITES_HPP 9 | #define BEAST_UNIT_TEST_GLOBAL_SUITES_HPP 10 | 11 | #include 12 | 13 | namespace beast { 14 | namespace unit_test { 15 | 16 | namespace detail { 17 | 18 | /// Holds test suites registered during static initialization. 19 | inline suite_list& 20 | global_suites() 21 | { 22 | static suite_list s; 23 | return s; 24 | } 25 | 26 | template 27 | struct insert_suite 28 | { 29 | insert_suite( 30 | char const* name, 31 | char const* module, 32 | char const* library, 33 | bool manual, 34 | int priority) 35 | { 36 | global_suites().insert(name, module, library, manual, priority); 37 | } 38 | }; 39 | 40 | } // namespace detail 41 | 42 | /// Holds test suites registered during static initialization. 43 | inline suite_list const& 44 | global_suites() 45 | { 46 | return detail::global_suites(); 47 | } 48 | 49 | } // namespace unit_test 50 | } // namespace beast 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /include/xrpl/crypto/README.md: -------------------------------------------------------------------------------- 1 | # SSLUtil 2 | 3 | This module exposes the OpenSSL headers and provides utilities to 4 | operate with OpenSSL / BIGNUM objects. 5 | -------------------------------------------------------------------------------- /include/xrpl/json/README.md: -------------------------------------------------------------------------------- 1 | # JSON 2 | 3 | Third party library to do JSON operations. 4 | -------------------------------------------------------------------------------- /include/xrpl/json/detail/json_assert.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_JSON_JSON_ASSERT_H_INCLUDED 21 | #define RIPPLE_JSON_JSON_ASSERT_H_INCLUDED 22 | 23 | #include 24 | #include 25 | 26 | #define JSON_ASSERT_MESSAGE(condition, message) \ 27 | if (!(condition)) \ 28 | ripple::Throw(message); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/xrpl/json/json_errors.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_JSON_JSON_ERRORS_H_INCLUDED 21 | #define RIPPLE_JSON_JSON_ERRORS_H_INCLUDED 22 | 23 | #include 24 | 25 | namespace Json { 26 | 27 | struct error : std::runtime_error 28 | { 29 | using std::runtime_error::runtime_error; 30 | }; 31 | 32 | } // namespace Json 33 | 34 | #endif // JSON_FORWARDS_H_INCLUDED 35 | -------------------------------------------------------------------------------- /include/xrpl/json/json_forwards.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_JSON_JSON_FORWARDS_H_INCLUDED 21 | #define RIPPLE_JSON_JSON_FORWARDS_H_INCLUDED 22 | 23 | namespace Json { 24 | 25 | // value.h 26 | using Int = int; 27 | using UInt = unsigned int; 28 | class StaticString; 29 | class Value; 30 | class ValueIteratorBase; 31 | class ValueIterator; 32 | class ValueConstIterator; 33 | 34 | } // namespace Json 35 | 36 | #endif // JSON_FORWARDS_H_INCLUDED 37 | -------------------------------------------------------------------------------- /include/xrpl/proto/README.md: -------------------------------------------------------------------------------- 1 | # Proto 2 | 3 | This holds protocol buffers source code. The protoc tool stores the output 4 | of the .proto files in the build directory. 5 | -------------------------------------------------------------------------------- /include/xrpl/proto/org/xrpl/rpc/v1/get_ledger_diff.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package org.xrpl.rpc.v1; 4 | option java_package = "org.xrpl.rpc.v1"; 5 | option java_multiple_files = true; 6 | 7 | import "org/xrpl/rpc/v1/ledger.proto"; 8 | 9 | 10 | // Get the state map difference between the two specified ledgers 11 | message GetLedgerDiffRequest 12 | { 13 | LedgerSpecifier base_ledger = 1; 14 | 15 | LedgerSpecifier desired_ledger = 2; 16 | 17 | // If true, include the full ledger object. If false, only keys are included. 18 | bool include_blobs = 3; 19 | 20 | // If the request needs to be forwarded from a reporting node to a p2p node, 21 | // the reporting node will set this field. Clients should not set this 22 | // field. 23 | string client_ip = 4; 24 | } 25 | 26 | message GetLedgerDiffResponse 27 | { 28 | // All ledger objects that were added, modified or deleted between 29 | // base_ledger and desired_ledger 30 | RawLedgerObjects ledger_objects = 1; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /include/xrpl/proto/org/xrpl/rpc/v1/get_ledger_entry.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package org.xrpl.rpc.v1; 4 | option java_package = "org.xrpl.rpc.v1"; 5 | option java_multiple_files = true; 6 | 7 | import "org/xrpl/rpc/v1/ledger.proto"; 8 | 9 | // Get a single ledger object 10 | message GetLedgerEntryRequest 11 | { 12 | // Key of the desired object 13 | bytes key = 1; 14 | 15 | // Ledger containing the object 16 | LedgerSpecifier ledger = 2; 17 | 18 | // If the request needs to be forwarded from a reporting node to a p2p node, 19 | // the reporting node will set this field. Clients should not set this 20 | // field. 21 | string client_ip = 3; 22 | } 23 | 24 | message GetLedgerEntryResponse 25 | { 26 | RawLedgerObject ledger_object = 1; 27 | 28 | // Ledger containing the object. Will match the value specified in the 29 | // request. 30 | LedgerSpecifier ledger = 2; 31 | } 32 | -------------------------------------------------------------------------------- /include/xrpl/proto/org/xrpl/rpc/v1/xrp_ledger.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package org.xrpl.rpc.v1; 4 | option java_package = "org.xrpl.rpc.v1"; 5 | option java_multiple_files = true; 6 | 7 | import "org/xrpl/rpc/v1/get_ledger.proto"; 8 | import "org/xrpl/rpc/v1/get_ledger_entry.proto"; 9 | import "org/xrpl/rpc/v1/get_ledger_data.proto"; 10 | import "org/xrpl/rpc/v1/get_ledger_diff.proto"; 11 | 12 | 13 | // These methods are binary only methods for retrieiving arbitrary ledger state 14 | // via gRPC. These methods are used by clio, but can also be 15 | // used by any client that wants to extract ledger state in an efficient manner. 16 | // They do not directly mimic the JSON equivalent methods. 17 | service XRPLedgerAPIService { 18 | 19 | // Get a specific ledger, optionally including transactions and any modified, 20 | // added or deleted ledger objects 21 | rpc GetLedger(GetLedgerRequest) returns (GetLedgerResponse); 22 | 23 | // Get a specific ledger object from a specific ledger 24 | rpc GetLedgerEntry(GetLedgerEntryRequest) returns (GetLedgerEntryResponse); 25 | 26 | // Iterate through all ledger objects in a specific ledger 27 | rpc GetLedgerData(GetLedgerDataRequest) returns (GetLedgerDataResponse); 28 | 29 | // Get all ledger objects that are different between the two specified 30 | // ledgers. Note, this method has no JSON equivalent. 31 | rpc GetLedgerDiff(GetLedgerDiffRequest) returns (GetLedgerDiffResponse); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /include/xrpl/protocol/Batch.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2024 Ripple Labs Inc. 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | */ 16 | //============================================================================== 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | namespace ripple { 23 | 24 | inline void 25 | serializeBatch( 26 | Serializer& msg, 27 | std::uint32_t const& flags, 28 | std::vector const& txids) 29 | { 30 | msg.add32(HashPrefix::batch); 31 | msg.add32(flags); 32 | msg.add32(std::uint32_t(txids.size())); 33 | for (auto const& txid : txids) 34 | msg.addBitString(txid); 35 | } 36 | 37 | } // namespace ripple -------------------------------------------------------------------------------- /include/xrpl/protocol/RPCErr.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_NET_RPCERR_H_INCLUDED 21 | #define RIPPLE_NET_RPCERR_H_INCLUDED 22 | 23 | #include 24 | 25 | namespace ripple { 26 | 27 | // VFALCO NOTE these are deprecated 28 | bool 29 | isRpcError(Json::Value jvResult); 30 | Json::Value 31 | rpcError(int iError); 32 | 33 | } // namespace ripple 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /include/xrpl/protocol/RippleLedgerHash.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_PROTOCOL_RIPPLELEDGERHASH_H_INCLUDED 21 | #define RIPPLE_PROTOCOL_RIPPLELEDGERHASH_H_INCLUDED 22 | 23 | #include 24 | 25 | namespace ripple { 26 | 27 | using LedgerHash = uint256; 28 | 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /include/xrpl/protocol/messages.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_PROTOCOL_MESSAGES_H_INCLUDED 21 | #define RIPPLE_PROTOCOL_MESSAGES_H_INCLUDED 22 | 23 | // Some versions of protobuf generate code that will produce errors during 24 | // compilation. See https://github.com/google/protobuf/issues/549 for more 25 | // details. We work around this by undefining this macro. 26 | // 27 | // TODO: Remove this after the protoc we use is upgraded to not generate 28 | // code that conflicts with the TYPE_BOOL macro. 29 | 30 | #ifdef TYPE_BOOL 31 | #undef TYPE_BOOL 32 | #endif 33 | 34 | #include 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/xrpl/resource/Types.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_RESOURCE_TYPES_H_INCLUDED 21 | #define RIPPLE_RESOURCE_TYPES_H_INCLUDED 22 | 23 | namespace ripple { 24 | namespace Resource { 25 | 26 | struct Key; 27 | struct Entry; 28 | 29 | } // namespace Resource 30 | } // namespace ripple 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /include/xrpl/server/detail/JSONRPCUtil.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_SERVER_JSONRPCUTIL_H_INCLUDED 21 | #define RIPPLE_SERVER_JSONRPCUTIL_H_INCLUDED 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | namespace ripple { 28 | 29 | void 30 | HTTPReply( 31 | int nStatus, 32 | std::string const& strMsg, 33 | Json::Output const&, 34 | beast::Journal j); 35 | 36 | } // namespace ripple 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/libxrpl/beast/insight/Collector.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of Beast: https://github.com/vinniefalco/Beast 4 | Copyright 2013, Vinnie Falco 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | 22 | namespace beast { 23 | namespace insight { 24 | 25 | Collector::~Collector() = default; 26 | } 27 | } // namespace beast 28 | -------------------------------------------------------------------------------- /src/libxrpl/beast/insight/Hook.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of Beast: https://github.com/vinniefalco/Beast 4 | Copyright 2013, Vinnie Falco 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | #include 22 | 23 | namespace beast { 24 | namespace insight { 25 | 26 | HookImpl::~HookImpl() = default; 27 | } 28 | } // namespace beast 29 | -------------------------------------------------------------------------------- /src/libxrpl/beast/insight/Metric.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of Beast: https://github.com/vinniefalco/Beast 4 | Copyright 2013, Vinnie Falco 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | namespace beast { 26 | namespace insight { 27 | 28 | CounterImpl::~CounterImpl() = default; 29 | 30 | EventImpl::~EventImpl() = default; 31 | 32 | GaugeImpl::~GaugeImpl() = default; 33 | 34 | MeterImpl::~MeterImpl() = default; 35 | } // namespace insight 36 | } // namespace beast 37 | -------------------------------------------------------------------------------- /src/libxrpl/beast/net/IPAddressV6.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of Beast: https://github.com/vinniefalco/Beast 4 | Copyright 2013, Vinnie Falco 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | #include 22 | 23 | namespace beast { 24 | namespace IP { 25 | 26 | bool 27 | is_private(AddressV6 const& addr) 28 | { 29 | return ( 30 | (addr.to_bytes()[0] & 0xfd) || // TODO fc00::/8 too ? 31 | (addr.is_v4_mapped() && is_private(addr.to_v4()))); 32 | } 33 | 34 | bool 35 | is_public(AddressV6 const& addr) 36 | { 37 | // TODO is this correct? 38 | return !is_private(addr) && !addr.is_multicast(); 39 | } 40 | 41 | } // namespace IP 42 | } // namespace beast 43 | -------------------------------------------------------------------------------- /src/libxrpl/crypto/secure_erase.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2020 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | 22 | #include 23 | 24 | #include 25 | 26 | namespace ripple { 27 | 28 | void 29 | secure_erase(void* dest, std::size_t bytes) 30 | { 31 | OPENSSL_cleanse(dest, bytes); 32 | } 33 | 34 | } // namespace ripple 35 | -------------------------------------------------------------------------------- /src/libxrpl/json/to_string.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | namespace Json { 26 | 27 | std::string 28 | to_string(Value const& value) 29 | { 30 | return FastWriter().write(value); 31 | } 32 | 33 | std::string 34 | pretty(Value const& value) 35 | { 36 | return StyledWriter().write(value); 37 | } 38 | 39 | } // namespace Json 40 | -------------------------------------------------------------------------------- /src/test/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Unit Tests 3 | 4 | ## Running Tests 5 | 6 | Unit tests are bundled in the `rippled` executable and can be executed using the 7 | `--unittest` parameter. Without any arguments to this option, all non-manual 8 | unit tests will be executed. If you want to run one or more manual tests, you 9 | must specify it by suite or full-name (e.g. `ripple.app.NoRippleCheckLimits` or 10 | just `NoRippleCheckLimits`). 11 | 12 | More than one suite or group of suites can be specified as a comma separated 13 | list via the argument. For example, `--unittest=beast,OversizeMeta` will run 14 | all suites in the `beast` library (root identifier) as well as the test suite 15 | named `OversizeMeta`). All name matches are case sensitive. 16 | 17 | Tests can be executed in parallel using several child processes by specifying 18 | the `--unittest-jobs=N` parameter. The default behavior is to execute serially 19 | using a single process. 20 | 21 | The order that suites are executed is determined by the suite priority that 22 | is optionally specified when the suite is declared in the code with one of the 23 | `BEAST_DEFINE_TESTSUITE` macros. By default, suites have a priority of 0, and 24 | other suites can choose to declare an integer priority value to make themselves 25 | execute before or after other suites based on their specified priority value. 26 | 27 | By default, the framework will emit the name of each testcase/testsuite when it 28 | starts and any messages sent to the suite `log` stream. The `--quiet` option will 29 | suppress both types of messages, but combining `--unittest-log` with `--quiet` 30 | will cause `log` messages to be emitted while suite/case names are suppressed. 31 | -------------------------------------------------------------------------------- /src/test/app/OfferStream_test.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | 22 | #include 23 | 24 | namespace ripple { 25 | 26 | class OfferStream_test : public beast::unit_test::suite 27 | { 28 | public: 29 | void 30 | test() 31 | { 32 | pass(); 33 | } 34 | 35 | void 36 | run() override 37 | { 38 | test(); 39 | } 40 | }; 41 | 42 | BEAST_DEFINE_TESTSUITE(OfferStream, tx, ripple); 43 | 44 | } // namespace ripple 45 | -------------------------------------------------------------------------------- /src/test/beast/beast_basic_seconds_clock_test.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of Beast: https://github.com/vinniefalco/Beast 4 | Copyright 2013, Vinnie Falco 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | #include 22 | 23 | namespace beast { 24 | 25 | class basic_seconds_clock_test : public unit_test::suite 26 | { 27 | public: 28 | void 29 | run() override 30 | { 31 | basic_seconds_clock::now(); 32 | pass(); 33 | } 34 | }; 35 | 36 | BEAST_DEFINE_TESTSUITE(basic_seconds_clock, chrono, beast); 37 | 38 | } // namespace beast 39 | -------------------------------------------------------------------------------- /src/test/beast/define_print.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2013-2016 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | // Include this .cpp in your project to gain access to the printing suite 15 | 16 | namespace beast { 17 | namespace unit_test { 18 | 19 | /** A suite that prints the list of globally defined suites. */ 20 | class print_test : public suite 21 | { 22 | public: 23 | void 24 | run() override 25 | { 26 | std::size_t manual = 0; 27 | std::size_t total = 0; 28 | 29 | auto prefix = [](suite_info const& s) { 30 | return s.manual() ? "|M| " : " "; 31 | }; 32 | 33 | for (auto const& s : global_suites()) 34 | { 35 | log << prefix(s) << s.full_name() << '\n'; 36 | 37 | if (s.manual()) 38 | ++manual; 39 | ++total; 40 | } 41 | 42 | log << amount(total, "suite") << " total, " 43 | << amount(manual, "manual suite") << std::endl; 44 | 45 | pass(); 46 | } 47 | }; 48 | 49 | BEAST_DEFINE_TESTSUITE_MANUAL(print, unit_test, beast); 50 | 51 | } // namespace unit_test 52 | } // namespace beast 53 | -------------------------------------------------------------------------------- /src/test/csf.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012-2017 Ripple Labs Inc 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | -------------------------------------------------------------------------------- /src/test/csf/csf_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRPLF/rippled/35a40a8e6236110bfbaa96d9a891728b4bae8a4e/src/test/csf/csf_graph.png -------------------------------------------------------------------------------- /src/test/csf/csf_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRPLF/rippled/35a40a8e6236110bfbaa96d9a891728b4bae8a4e/src/test/csf/csf_overview.png -------------------------------------------------------------------------------- /src/test/jtx/JSONRPCClient.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2016 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_TEST_HTTPCLIENT_H_INCLUDED 21 | #define RIPPLE_TEST_HTTPCLIENT_H_INCLUDED 22 | 23 | #include 24 | 25 | #include 26 | 27 | #include 28 | 29 | namespace ripple { 30 | namespace test { 31 | 32 | /** Returns a client using JSON-RPC over HTTP/S. */ 33 | std::unique_ptr 34 | makeJSONRPCClient(Config const& cfg, unsigned rpc_version = 2); 35 | 36 | } // namespace test 37 | } // namespace ripple 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/test/jtx/SignerUtils.h: -------------------------------------------------------------------------------- 1 | #ifndef RIPPLE_TEST_JTX_SIGNERUTILS_H_INCLUDED 2 | #define RIPPLE_TEST_JTX_SIGNERUTILS_H_INCLUDED 3 | 4 | #include 5 | 6 | #include 7 | 8 | namespace ripple { 9 | namespace test { 10 | namespace jtx { 11 | 12 | struct Reg 13 | { 14 | Account acct; 15 | Account sig; 16 | 17 | Reg(Account const& masterSig) : acct(masterSig), sig(masterSig) 18 | { 19 | } 20 | 21 | Reg(Account const& acct_, Account const& regularSig) 22 | : acct(acct_), sig(regularSig) 23 | { 24 | } 25 | 26 | Reg(char const* masterSig) : acct(masterSig), sig(masterSig) 27 | { 28 | } 29 | 30 | Reg(char const* acct_, char const* regularSig) 31 | : acct(acct_), sig(regularSig) 32 | { 33 | } 34 | 35 | bool 36 | operator<(Reg const& rhs) const 37 | { 38 | return acct < rhs.acct; 39 | } 40 | }; 41 | 42 | // Utility function to sort signers 43 | inline void 44 | sortSigners(std::vector& signers) 45 | { 46 | std::sort( 47 | signers.begin(), signers.end(), [](Reg const& lhs, Reg const& rhs) { 48 | return lhs.acct < rhs.acct; 49 | }); 50 | } 51 | 52 | } // namespace jtx 53 | } // namespace test 54 | } // namespace ripple 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/test/jtx/account_txn_id.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_TEST_JTX_ACCOUNT_TXN_ID_H_INCLUDED 21 | #define RIPPLE_TEST_JTX_ACCOUNT_TXN_ID_H_INCLUDED 22 | 23 | #include 24 | 25 | namespace ripple { 26 | namespace test { 27 | namespace jtx { 28 | 29 | struct account_txn_id 30 | { 31 | private: 32 | uint256 hash_; 33 | 34 | public: 35 | explicit account_txn_id(uint256 const& hash) : hash_(hash) 36 | { 37 | } 38 | 39 | void 40 | operator()(Env&, JTx& jt) const; 41 | }; 42 | } // namespace jtx 43 | } // namespace test 44 | } // namespace ripple 45 | #endif 46 | -------------------------------------------------------------------------------- /src/test/jtx/domain.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2025 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #pragma once 21 | 22 | #include 23 | 24 | namespace ripple { 25 | namespace test { 26 | namespace jtx { 27 | 28 | /** Set the domain on a JTx. */ 29 | class domain 30 | { 31 | private: 32 | uint256 v_; 33 | 34 | public: 35 | explicit domain(uint256 const& v) : v_(v) 36 | { 37 | } 38 | 39 | void 40 | operator()(Env&, JTx& jt) const; 41 | }; 42 | 43 | } // namespace jtx 44 | } // namespace test 45 | } // namespace ripple 46 | -------------------------------------------------------------------------------- /src/test/jtx/impl/account_txn_id.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | 22 | namespace ripple { 23 | namespace test { 24 | namespace jtx { 25 | 26 | void 27 | account_txn_id::operator()(Env&, JTx& jt) const 28 | { 29 | if (!hash_.isZero()) 30 | jt["AccountTxnID"] = strHex(hash_); 31 | } 32 | 33 | } // namespace jtx 34 | } // namespace test 35 | } // namespace ripple 36 | -------------------------------------------------------------------------------- /src/test/jtx/impl/delivermin.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | 22 | #include 23 | 24 | namespace ripple { 25 | namespace test { 26 | namespace jtx { 27 | 28 | void 29 | delivermin::operator()(Env& env, JTx& jt) const 30 | { 31 | jt.jv[jss::DeliverMin] = amount_.getJson(JsonOptions::none); 32 | } 33 | 34 | } // namespace jtx 35 | } // namespace test 36 | } // namespace ripple 37 | -------------------------------------------------------------------------------- /src/test/jtx/impl/domain.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2025 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | 22 | #include 23 | 24 | namespace ripple { 25 | namespace test { 26 | namespace jtx { 27 | 28 | void 29 | domain::operator()(Env&, JTx& jt) const 30 | { 31 | jt[sfDomainID.jsonName] = to_string(v_); 32 | } 33 | 34 | } // namespace jtx 35 | } // namespace test 36 | } // namespace ripple 37 | -------------------------------------------------------------------------------- /src/test/jtx/impl/fee.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | 22 | #include 23 | 24 | namespace ripple { 25 | namespace test { 26 | namespace jtx { 27 | 28 | void 29 | fee::operator()(Env&, JTx& jt) const 30 | { 31 | if (!manual_) 32 | return; 33 | jt.fill_fee = false; 34 | if (amount_) 35 | jt[jss::Fee] = amount_->getJson(JsonOptions::none); 36 | } 37 | 38 | } // namespace jtx 39 | } // namespace test 40 | } // namespace ripple 41 | -------------------------------------------------------------------------------- /src/test/jtx/impl/invoice_id.cpp: -------------------------------------------------------------------------------- 1 | 2 | //------------------------------------------------------------------------------ 3 | /* 4 | This file is part of rippled: https://github.com/ripple/rippled 5 | Copyright (c) 2012, 2013 Ripple Labs Inc. 6 | 7 | Permission to use, copy, modify, and/or distribute this software for any 8 | purpose with or without fee is hereby granted, provided that the above 9 | copyright notice and this permission notice appear in all copies. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 | */ 19 | //============================================================================== 20 | 21 | #include 22 | 23 | namespace ripple { 24 | namespace test { 25 | namespace jtx { 26 | 27 | void 28 | invoice_id::operator()(Env&, JTx& jt) const 29 | { 30 | if (!hash_.isZero()) 31 | jt["InvoiceID"] = strHex(hash_); 32 | } 33 | 34 | } // namespace jtx 35 | } // namespace test 36 | } // namespace ripple 37 | -------------------------------------------------------------------------------- /src/test/jtx/impl/last_ledger_sequence.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | 22 | namespace ripple { 23 | namespace test { 24 | namespace jtx { 25 | 26 | void 27 | last_ledger_seq::operator()(Env&, JTx& jt) const 28 | { 29 | jt["LastLedgerSequence"] = num_; 30 | } 31 | 32 | } // namespace jtx 33 | } // namespace test 34 | } // namespace ripple 35 | -------------------------------------------------------------------------------- /src/test/jtx/impl/sendmax.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | 22 | #include 23 | 24 | namespace ripple { 25 | namespace test { 26 | namespace jtx { 27 | 28 | void 29 | sendmax::operator()(Env& env, JTx& jt) const 30 | { 31 | jt.jv[jss::SendMax] = amount_.getJson(JsonOptions::none); 32 | } 33 | 34 | } // namespace jtx 35 | } // namespace test 36 | } // namespace ripple 37 | -------------------------------------------------------------------------------- /src/test/jtx/impl/seq.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | 22 | #include 23 | 24 | namespace ripple { 25 | namespace test { 26 | namespace jtx { 27 | 28 | void 29 | seq::operator()(Env&, JTx& jt) const 30 | { 31 | if (!manual_) 32 | return; 33 | jt.fill_seq = false; 34 | if (num_) 35 | jt[jss::Sequence] = *num_; 36 | } 37 | 38 | } // namespace jtx 39 | } // namespace test 40 | } // namespace ripple 41 | -------------------------------------------------------------------------------- /src/test/jtx/impl/sig.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | #include 22 | 23 | namespace ripple { 24 | namespace test { 25 | namespace jtx { 26 | 27 | void 28 | sig::operator()(Env&, JTx& jt) const 29 | { 30 | if (!manual_) 31 | return; 32 | jt.fill_sig = false; 33 | if (account_) 34 | { 35 | // VFALCO Inefficient pre-C++14 36 | auto const account = *account_; 37 | jt.signer = [account](Env&, JTx& jtx) { jtx::sign(jtx.jv, account); }; 38 | } 39 | } 40 | 41 | } // namespace jtx 42 | } // namespace test 43 | } // namespace ripple 44 | -------------------------------------------------------------------------------- /src/test/jtx/impl/tag.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | 22 | namespace ripple { 23 | namespace test { 24 | namespace jtx { 25 | 26 | void 27 | dtag::operator()(Env&, JTx& jt) const 28 | { 29 | jt.jv["DestinationTag"] = value_; 30 | } 31 | 32 | void 33 | stag::operator()(Env&, JTx& jt) const 34 | { 35 | jt.jv["SourceTag"] = value_; 36 | } 37 | 38 | } // namespace jtx 39 | } // namespace test 40 | } // namespace ripple 41 | -------------------------------------------------------------------------------- /src/test/jtx/impl/txflags.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | 22 | #include 23 | 24 | namespace ripple { 25 | namespace test { 26 | namespace jtx { 27 | 28 | void 29 | txflags::operator()(Env&, JTx& jt) const 30 | { 31 | jt[jss::Flags] = v_ /*| tfFullyCanonicalSig*/; 32 | } 33 | 34 | } // namespace jtx 35 | } // namespace test 36 | } // namespace ripple 37 | -------------------------------------------------------------------------------- /src/test/jtx/invoice_id.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_TEST_JTX_INVOICE_ID_H_INCLUDED 21 | #define RIPPLE_TEST_JTX_INVOICE_ID_H_INCLUDED 22 | 23 | #include 24 | 25 | namespace ripple { 26 | namespace test { 27 | namespace jtx { 28 | 29 | struct invoice_id 30 | { 31 | private: 32 | uint256 hash_; 33 | 34 | public: 35 | explicit invoice_id(uint256 const& hash) : hash_(hash) 36 | { 37 | } 38 | 39 | void 40 | operator()(Env&, JTx& jt) const; 41 | }; 42 | } // namespace jtx 43 | } // namespace test 44 | } // namespace ripple 45 | #endif 46 | -------------------------------------------------------------------------------- /src/test/jtx/last_ledger_sequence.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_TEST_JTX_LAST_LEDGER_SEQUENCE_H_INCLUDED 21 | #define RIPPLE_TEST_JTX_LAST_LEDGER_SEQUENCE_H_INCLUDED 22 | 23 | #include 24 | 25 | namespace ripple { 26 | namespace test { 27 | namespace jtx { 28 | 29 | struct last_ledger_seq 30 | { 31 | private: 32 | std::uint32_t num_; 33 | 34 | public: 35 | explicit last_ledger_seq(std::uint32_t num) : num_(num) 36 | { 37 | } 38 | 39 | void 40 | operator()(Env&, JTx& jt) const; 41 | }; 42 | 43 | } // namespace jtx 44 | } // namespace test 45 | } // namespace ripple 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/test/jtx/noop.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_TEST_JTX_NOOP_H_INCLUDED 21 | #define RIPPLE_TEST_JTX_NOOP_H_INCLUDED 22 | 23 | #include 24 | 25 | namespace ripple { 26 | namespace test { 27 | namespace jtx { 28 | 29 | /** The null transaction. */ 30 | inline Json::Value 31 | noop(Account const& account) 32 | { 33 | return fset(account, 0); 34 | } 35 | 36 | } // namespace jtx 37 | } // namespace test 38 | } // namespace ripple 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/test/jtx/pay.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_TEST_JTX_PAY_H_INCLUDED 21 | #define RIPPLE_TEST_JTX_PAY_H_INCLUDED 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | namespace ripple { 29 | namespace test { 30 | namespace jtx { 31 | 32 | /** Create a payment. */ 33 | Json::Value 34 | pay(AccountID const& account, AccountID const& to, AnyAmount amount); 35 | Json::Value 36 | pay(Account const& account, Account const& to, AnyAmount amount); 37 | 38 | } // namespace jtx 39 | } // namespace test 40 | } // namespace ripple 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/test/jtx/rate.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_TEST_JTX_RATE_H_INCLUDED 21 | #define RIPPLE_TEST_JTX_RATE_H_INCLUDED 22 | 23 | #include 24 | 25 | #include 26 | 27 | namespace ripple { 28 | namespace test { 29 | namespace jtx { 30 | 31 | /** Set a transfer rate. */ 32 | Json::Value 33 | rate(Account const& account, double multiplier); 34 | 35 | } // namespace jtx 36 | } // namespace test 37 | } // namespace ripple 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/test/jtx/requires.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_TEST_JTX_REQUIRES_H_INCLUDED 21 | #define RIPPLE_TEST_JTX_REQUIRES_H_INCLUDED 22 | 23 | #include 24 | #include 25 | 26 | namespace ripple { 27 | namespace test { 28 | namespace jtx { 29 | 30 | class Env; 31 | 32 | using require_t = std::function; 33 | using requires_t = std::vector; 34 | 35 | } // namespace jtx 36 | } // namespace test 37 | } // namespace ripple 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/test/jtx/txflags.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_TEST_JTX_TXFLAGS_H_INCLUDED 21 | #define RIPPLE_TEST_JTX_TXFLAGS_H_INCLUDED 22 | 23 | #include 24 | 25 | namespace ripple { 26 | namespace test { 27 | namespace jtx { 28 | 29 | /** Set the flags on a JTx. */ 30 | class txflags 31 | { 32 | private: 33 | std::uint32_t v_; 34 | 35 | public: 36 | explicit txflags(std::uint32_t v) : v_(v) 37 | { 38 | } 39 | 40 | void 41 | operator()(Env&, JTx& jt) const; 42 | }; 43 | 44 | } // namespace jtx 45 | } // namespace test 46 | } // namespace ripple 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/xrpld/README.md: -------------------------------------------------------------------------------- 1 | # Ripple Source Guidelines 2 | 3 | Each folder contains a single module following the newest style: 4 | 5 | - One class per header 6 | - As much implementation hidden as possible 7 | - All major interfaces are abstract 8 | - Every class is documented 9 | - Each module focuses on solving one problem 10 | -------------------------------------------------------------------------------- /src/xrpld/app/consensus/README.md: -------------------------------------------------------------------------------- 1 | # RCL Consensus 2 | 3 | This directory holds the types and classes needed 4 | to connect the generic consensus algorithm to the 5 | rippled-specific instance of consensus. 6 | 7 | * `RCLCxTx` adapts a `SHAMapItem` transaction. 8 | * `RCLCxTxSet` adapts a `SHAMap` to represent a set of transactions. 9 | * `RCLCxLedger` adapts a `Ledger`. 10 | * `RCLConsensus` is implements the requirements of the generic 11 | `Consensus` class by connecting to the rest of the `rippled` 12 | application. 13 | 14 | -------------------------------------------------------------------------------- /src/xrpld/app/ledger/AccountStateSF.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | 22 | namespace ripple { 23 | 24 | void 25 | AccountStateSF::gotNode( 26 | bool, 27 | SHAMapHash const& nodeHash, 28 | std::uint32_t ledgerSeq, 29 | Blob&& nodeData, 30 | SHAMapNodeType) const 31 | { 32 | db_.store( 33 | hotACCOUNT_NODE, std::move(nodeData), nodeHash.as_uint256(), ledgerSeq); 34 | } 35 | 36 | std::optional 37 | AccountStateSF::getNode(SHAMapHash const& nodeHash) const 38 | { 39 | return fp_.getFetchPack(nodeHash.as_uint256()); 40 | } 41 | 42 | } // namespace ripple 43 | -------------------------------------------------------------------------------- /src/xrpld/app/main/Tuning.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_APP_MAIN_TUNING_H_INCLUDED 21 | #define RIPPLE_APP_MAIN_TUNING_H_INCLUDED 22 | 23 | #include 24 | 25 | namespace ripple { 26 | 27 | constexpr std::size_t fullBelowTargetSize = 524288; 28 | constexpr std::chrono::seconds fullBelowExpiration = std::chrono::minutes{10}; 29 | 30 | constexpr std::size_t maxPoppedTransactions = 10; 31 | 32 | } // namespace ripple 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/xrpld/app/rdb/Vacuum.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2021 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_APP_RDB_VACUUM_H_INCLUDED 21 | #define RIPPLE_APP_RDB_VACUUM_H_INCLUDED 22 | 23 | #include 24 | 25 | namespace ripple { 26 | 27 | /** 28 | * @brief doVacuumDB Creates, initialises, and performs cleanup on a database. 29 | * @param setup Path to the database and other opening parameters. 30 | * @param j Journal. 31 | * @return True if the vacuum process completed successfully. 32 | */ 33 | bool 34 | doVacuumDB(DatabaseCon::Setup const& setup, beast::Journal j); 35 | 36 | } // namespace ripple 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/xrpld/consensus/README.md: -------------------------------------------------------------------------------- 1 | # Consensus 2 | 3 | This directory contains the implementation of a 4 | generic consensus algorithm. The implementation 5 | follows a CRTP design, requiring client code to implement 6 | specific functions and types to use consensus in their 7 | application. The interface is undergoing refactoring and 8 | is not yet finalized. 9 | 10 | -------------------------------------------------------------------------------- /src/xrpld/ledger/CachedSLEs.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_LEDGER_CACHEDSLES_H_INCLUDED 21 | #define RIPPLE_LEDGER_CACHEDSLES_H_INCLUDED 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | namespace ripple { 28 | using CachedSLEs = TaggedCache; 29 | } 30 | 31 | #endif // RIPPLE_LEDGER_CACHEDSLES_H_INCLUDED 32 | -------------------------------------------------------------------------------- /src/xrpld/net/images/interrupt_sequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRPLF/rippled/35a40a8e6236110bfbaa96d9a891728b4bae8a4e/src/xrpld/net/images/interrupt_sequence.png -------------------------------------------------------------------------------- /src/xrpld/net/images/states.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRPLF/rippled/35a40a8e6236110bfbaa96d9a891728b4bae8a4e/src/xrpld/net/images/states.png -------------------------------------------------------------------------------- /src/xrpld/nodestore/Task.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_NODESTORE_TASK_H_INCLUDED 21 | #define RIPPLE_NODESTORE_TASK_H_INCLUDED 22 | 23 | namespace ripple { 24 | namespace NodeStore { 25 | 26 | /** Derived classes perform scheduled tasks. */ 27 | struct Task 28 | { 29 | virtual ~Task() = default; 30 | 31 | /** Performs the task. 32 | The call may take place on a foreign thread. 33 | */ 34 | virtual void 35 | performScheduledTask() = 0; 36 | }; 37 | 38 | } // namespace NodeStore 39 | } // namespace ripple 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/xrpld/nodestore/detail/DummyScheduler.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | 22 | namespace ripple { 23 | namespace NodeStore { 24 | 25 | void 26 | DummyScheduler::scheduleTask(Task& task) 27 | { 28 | // Invoke the task synchronously. 29 | task.performScheduledTask(); 30 | } 31 | 32 | void 33 | DummyScheduler::onFetch(FetchReport const& report) 34 | { 35 | } 36 | 37 | void 38 | DummyScheduler::onBatchWrite(BatchWriteReport const& report) 39 | { 40 | } 41 | 42 | } // namespace NodeStore 43 | } // namespace ripple 44 | -------------------------------------------------------------------------------- /src/xrpld/peerfinder/detail/Endpoint.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | #include 22 | 23 | namespace ripple { 24 | namespace PeerFinder { 25 | 26 | Endpoint::Endpoint(beast::IP::Endpoint const& ep, std::uint32_t hops_) 27 | : hops(std::min(hops_, Tuning::maxHops + 1)), address(ep) 28 | { 29 | } 30 | 31 | } // namespace PeerFinder 32 | } // namespace ripple 33 | -------------------------------------------------------------------------------- /src/xrpld/rpc/Output.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_RPC_OUTPUT_H_INCLUDED 21 | #define RIPPLE_RPC_OUTPUT_H_INCLUDED 22 | 23 | #include 24 | 25 | namespace ripple { 26 | namespace RPC { 27 | 28 | using Output = std::function; 29 | 30 | inline Output 31 | stringOutput(std::string& s) 32 | { 33 | return [&](boost::string_ref const& b) { s.append(b.data(), b.size()); }; 34 | } 35 | 36 | } // namespace RPC 37 | } // namespace ripple 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/xrpld/rpc/RPCHandler.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_RPC_RPCHANDLER_H_INCLUDED 21 | #define RIPPLE_RPC_RPCHANDLER_H_INCLUDED 22 | 23 | #include 24 | #include 25 | 26 | namespace ripple { 27 | namespace RPC { 28 | 29 | struct JsonContext; 30 | 31 | /** Execute an RPC command and store the results in a Json::Value. */ 32 | Status 33 | doCommand(RPC::JsonContext&, Json::Value&); 34 | 35 | Role 36 | roleRequired(unsigned int version, bool betaEnabled, std::string const& method); 37 | 38 | } // namespace RPC 39 | } // namespace ripple 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/xrpld/rpc/handlers/BlackList.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012-2014 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | namespace ripple { 27 | 28 | Json::Value 29 | doBlackList(RPC::JsonContext& context) 30 | { 31 | auto& rm = context.app.getResourceManager(); 32 | if (context.params.isMember(jss::threshold)) 33 | return rm.getJson(context.params[jss::threshold].asInt()); 34 | else 35 | return rm.getJson(); 36 | } 37 | 38 | } // namespace ripple 39 | -------------------------------------------------------------------------------- /src/xrpld/rpc/handlers/ConsensusInfo.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012-2014 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | namespace ripple { 28 | 29 | Json::Value 30 | doConsensusInfo(RPC::JsonContext& context) 31 | { 32 | Json::Value ret(Json::objectValue); 33 | 34 | ret[jss::info] = context.netOps.getConsensusInfo(); 35 | 36 | return ret; 37 | } 38 | 39 | } // namespace ripple 40 | -------------------------------------------------------------------------------- /src/xrpld/rpc/handlers/GetCounts.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012-2019 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_RPC_HANDLERS_GETCOUNTS_H_INCLUDED 21 | #define RIPPLE_RPC_HANDLERS_GETCOUNTS_H_INCLUDED 22 | 23 | #include 24 | 25 | #include 26 | 27 | namespace ripple { 28 | 29 | Json::Value 30 | getCountsJson(Application& app, int minObjectCount); 31 | 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/xrpld/rpc/handlers/LedgerCleanerHandler.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012-2014 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | namespace ripple { 28 | 29 | Json::Value 30 | doLedgerCleaner(RPC::JsonContext& context) 31 | { 32 | context.app.getLedgerCleaner().clean(context.params); 33 | return RPC::makeObjectValue("Cleaner configured"); 34 | } 35 | 36 | } // namespace ripple 37 | -------------------------------------------------------------------------------- /src/xrpld/rpc/handlers/LedgerCurrent.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012-2014 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | namespace ripple { 28 | 29 | Json::Value 30 | doLedgerCurrent(RPC::JsonContext& context) 31 | { 32 | Json::Value jvResult; 33 | jvResult[jss::ledger_current_index] = 34 | context.ledgerMaster.getCurrentLedgerIndex(); 35 | return jvResult; 36 | } 37 | 38 | } // namespace ripple 39 | -------------------------------------------------------------------------------- /src/xrpld/rpc/handlers/LogRotate.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012-2014 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | namespace ripple { 27 | 28 | Json::Value 29 | doLogRotate(RPC::JsonContext& context) 30 | { 31 | context.app.getPerfLog().rotate(); 32 | return RPC::makeObjectValue(context.app.logs().rotate()); 33 | } 34 | 35 | } // namespace ripple 36 | -------------------------------------------------------------------------------- /src/xrpld/rpc/handlers/Stop.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012-2014 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | namespace ripple { 26 | 27 | namespace RPC { 28 | struct JsonContext; 29 | } 30 | 31 | Json::Value 32 | doStop(RPC::JsonContext& context) 33 | { 34 | context.app.signalStop(); 35 | return RPC::makeObjectValue(systemName() + " server stopping"); 36 | } 37 | 38 | } // namespace ripple 39 | -------------------------------------------------------------------------------- /src/xrpld/rpc/handlers/TxReduceRelay.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012-2020 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | namespace ripple { 27 | 28 | Json::Value 29 | doTxReduceRelay(RPC::JsonContext& context) 30 | { 31 | return context.app.overlay().txMetrics(); 32 | } 33 | 34 | } // namespace ripple 35 | -------------------------------------------------------------------------------- /src/xrpld/rpc/handlers/ValidatorListSites.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012-2014 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | namespace ripple { 27 | 28 | Json::Value 29 | doValidatorListSites(RPC::JsonContext& context) 30 | { 31 | return context.app.validatorSites().getJson(); 32 | } 33 | 34 | } // namespace ripple 35 | -------------------------------------------------------------------------------- /src/xrpld/rpc/handlers/Validators.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012-2014 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | namespace ripple { 27 | 28 | Json::Value 29 | doValidators(RPC::JsonContext& context) 30 | { 31 | return context.app.validators().getJson(); 32 | } 33 | 34 | } // namespace ripple 35 | -------------------------------------------------------------------------------- /src/xrpld/rpc/handlers/WalletPropose.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2015 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLED_RIPPLE_RPC_HANDLERS_WALLETPROPOSE_H 21 | #define RIPPLED_RIPPLE_RPC_HANDLERS_WALLETPROPOSE_H 22 | 23 | #include 24 | 25 | namespace ripple { 26 | 27 | Json::Value 28 | walletPropose(Json::Value const& params); 29 | 30 | } // namespace ripple 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/xrpld/shamap/TreeNodeCache.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of rippled: https://github.com/ripple/rippled 4 | Copyright (c) 2012, 2013 Ripple Labs Inc. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | //============================================================================== 19 | 20 | #ifndef RIPPLE_SHAMAP_TREENODECACHE_H_INCLUDED 21 | #define RIPPLE_SHAMAP_TREENODECACHE_H_INCLUDED 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | 28 | namespace ripple { 29 | 30 | using TreeNodeCache = TaggedCache< 31 | uint256, 32 | SHAMapTreeNode, 33 | /*IsKeyCache*/ false, 34 | intr_ptr::SharedWeakUnionPtr, 35 | intr_ptr::SharedPtr>; 36 | } // namespace ripple 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | # Integration tests 2 | This directory contains integration tests for the project. These tests are run 3 | against the `libxrpl` library or `rippled` binary to verify they are working as 4 | expected. 5 | -------------------------------------------------------------------------------- /tests/conan/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.21) 2 | 3 | set(name example) 4 | set(version 0.1.0) 5 | 6 | project( 7 | ${name} 8 | VERSION ${version} 9 | LANGUAGES CXX 10 | ) 11 | 12 | find_package(xrpl REQUIRED) 13 | 14 | add_executable(example) 15 | target_sources(example PRIVATE src/example.cpp) 16 | target_link_libraries(example PRIVATE xrpl::libxrpl) 17 | -------------------------------------------------------------------------------- /tests/conan/src/example.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | int 6 | main(int argc, char const** argv) 7 | { 8 | std::printf("%s\n", ripple::BuildInfo::getVersionString().c_str()); 9 | return 0; 10 | } 11 | --------------------------------------------------------------------------------