mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-05 17:56:49 +00:00
* XRPLF/ximinez/number-fix-maxrepcusp:
fix: Disable unnecessary sanity-check in VaultDeposit (7288)
ci: [DEPENDABOT] bump actions/upload-artifact from 7.0.0 to 7.0.1 (7286)
ci: Only run reusable package in public repos (7293)
fix: Set default peering port to 2459 (6848)
fix: Use account ledger entry when canceling token escrows (6171)
refactor: Rename `account_` to `accountID_` (7284)
ci: Add Linux package builds (DEB + RPM) to CI (6639)
refactor: Clean up comments post-clang-tidy changes (7283)
release: Set version to 3.3.0-b0 (7280)
refactor: Rename static constants (7120)
refactor: Use `isFlag` where possible instead of bitwise math (7278)
ci: Update XRPLF/actions (7281)
clang-tidy: this is ridiculous
clang-tidy: {}
68 lines
1.8 KiB
C++
68 lines
1.8 KiB
C++
#pragma once
|
|
|
|
#include <xrpl/basics/chrono.h>
|
|
#include <xrpl/protocol/XRPAmount.h>
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
|
|
namespace xrpl {
|
|
|
|
// Various protocol and system specific constant globals.
|
|
|
|
/* The name of the system. */
|
|
static inline std::string const&
|
|
systemName()
|
|
{
|
|
static std::string const kName = "xrpld";
|
|
return kName;
|
|
}
|
|
|
|
/** Configure the native currency. */
|
|
|
|
/** Number of drops in the genesis account. */
|
|
constexpr XRPAmount kInitialXrp{100'000'000'000 * kDropsPerXrp};
|
|
static_assert(kInitialXrp.drops() == 100'000'000'000'000'000);
|
|
static_assert(Number::kLargestMantissa >= kInitialXrp.drops());
|
|
|
|
/** Returns true if the amount does not exceed the initial XRP in existence. */
|
|
inline bool
|
|
isLegalAmount(XRPAmount const& amount)
|
|
{
|
|
return amount <= kInitialXrp;
|
|
}
|
|
|
|
/** Returns true if the absolute value of the amount does not exceed the initial
|
|
* XRP in existence. */
|
|
inline bool
|
|
isLegalAmountSigned(XRPAmount const& amount)
|
|
{
|
|
return amount >= -kInitialXrp && amount <= kInitialXrp;
|
|
}
|
|
|
|
/* The currency code for the native currency. */
|
|
static inline std::string const&
|
|
systemCurrencyCode()
|
|
{
|
|
static std::string const kCode = "XRP";
|
|
return kCode;
|
|
}
|
|
|
|
/** The XRP ledger network's earliest allowed sequence */
|
|
static constexpr std::uint32_t kXrpLedgerEarliestSeq{32570u};
|
|
|
|
/** The XRP Ledger mainnet's earliest ledger with a FeeSettings object. Only
|
|
* used in asserts and tests. */
|
|
static constexpr std::uint32_t kXrpLedgerEarliestFees{562177u};
|
|
|
|
/** The minimum amount of support an amendment should have. */
|
|
constexpr std::ratio<80, 100> kAmendmentMajorityCalcThreshold;
|
|
|
|
/** The minimum amount of time an amendment must hold a majority */
|
|
constexpr std::chrono::seconds const kDefaultAmendmentMajorityTime = weeks{2};
|
|
|
|
} // namespace xrpl
|
|
|
|
/** Default peer port (IANA registered) */
|
|
inline constexpr std::uint16_t kDefaultPeerPort{2459};
|