Compare commits

..

34 Commits

Author SHA1 Message Date
Valentin Balaschenko
3592bd43c1 clang and levelization 2025-05-22 17:58:28 +01:00
Valentin Balaschenko
aa14097b02 measureDurationAndLog wip 2 2025-05-22 17:49:52 +01:00
Valentin Balaschenko
8a5f95c223 measureDurationAndLog wip 1 2025-05-22 17:29:56 +01:00
Valentin Balaschenko
fbda5ccc15 Ledger master duration 2025-05-22 17:16:38 +01:00
Valentin Balaschenko
4cc37b9cd8 networkops duration measure 2025-05-22 16:50:32 +01:00
Valentin Balaschenko
3495cb3753 PeerImp measure duration 2025-05-22 13:35:57 +01:00
Bronek Kozicki
e514de76ed Add single asset vault (XLS-65d) (#5224)
- Specification: XRPLF/XRPL-Standards#239
- Amendment: `SingleAssetVault`
- Implements a vault feature used to store a fungible asset (XRP, IOU, or MPT, but not NFT) and to receive shares in the vault (an MPT) in exchange.
- A vault can be private or public.
- A private vault can use permissioned domains, subject to the `PermissionedDomains` amendment.
- Shares can be exchanged back into asset with `VaultWithdraw`.
- Permissions on the asset in the vault are transitively applied on shares in the vault.
- Issuer of the asset in the vault can clawback with `VaultClawback`.
- Extended `MPTokenIssuance` with `DomainID`, used by the permissioned domain on the vault shares.

Co-authored-by: John Freeman <jfreeman08@gmail.com>
2025-05-20 14:06:41 -04:00
Bart
dd62cfcc22 fix: Update path in CODEOWNERS (#5440) 2025-05-20 15:24:07 +00:00
Michael Legleux
09690f1b38 Set version to 2.5.0-b1 2025-05-18 20:39:18 +01:00
Valentin Balaschenko
380ba9f1c1 Fix: Resolve slow test on macOS pipeline (#5392)
Using std::barrier performs extremely poorly (~1 hour vs ~1 minute to run the test suite) in certain macOS environments.
To unblock our macOS CI pipeline, std::barrier has been replaced with a custom mutex-based barrier (Barrier) that significantly improves performance without compromising correctness.
2025-05-16 10:31:51 +00:00
brettmollin
c3e9380fb4 fix: Update validators-example.txt fix xrplf example URL (#5384) 2025-05-16 09:49:14 +00:00
Jingchen
e3ebc253fa fix: Ensure that coverage file generation is atomic. (#5426)
Running unit tests in parallel and multiple threads can write into one file can corrupt output files, and then gcovr won't be able to parse the corrupted file. This change adds -fprofile-update=atomic as instructed by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68080.
2025-05-12 14:54:01 +00:00
Bart
c6c7c84355 Configure CODEOWNERS for changes to RPC code (#5266)
To ensure changes to any RPC-related code are compatible with other services, such as Clio, the RPC team will be required to review them.
2025-05-12 12:42:03 +00:00
yinyiqian1
28f50cb7cf fix: enable LedgerStateFix for delegation (#5427) 2025-05-10 10:36:11 -04:00
Vito Tumas
3e152fec74 refactor: use east const convention (#5409)
This change refactors the codebase to use the "east const convention", and adds a clang-format rule to follow this convention.
2025-05-08 11:00:42 +00:00
yinyiqian1
2db2791805 Add PermissionDelegation feature (#5354)
This change implements the account permission delegation described in XLS-75d, see https://github.com/XRPLF/XRPL-Standards/pull/257.

* Introduces transaction-level and granular permissions that can be delegated to other accounts.
* Adds `DelegateSet` transaction to grant specified permissions to another account.
* Adds `ltDelegate` ledger object to maintain the permission list for delegating/delegated account pair.
* Adds an optional `Delegate` field in common fields, allowing a delegated account to send transactions on behalf of the delegating account within the granted permission scope. The `Account` field remains the delegating account; the `Delegate` field specifies the delegated account. The transaction is signed by the delegated account.
2025-05-08 06:14:02 -04:00
Vito Tumas
9ec2d7f8ff Enable passive squelching (#5358)
This change updates the squelching logic to accept squelch messages for untrusted validators. As a result, servers will also squelch untrusted validator messages reducing duplicate traffic they generate.

In particular:
* Updates squelch message handling logic to squelch messages for all validators, not only trusted ones.
* Updates the logic to send squelch messages to peers that don't squelch themselves
* Increases the threshold for the number of messages that a peer has to deliver to consider it as a candidate for validator messages.
2025-05-02 11:01:45 -04:00
Ed Hennis
4a084ce34c Improve transaction relay logic (#4985)
Combines four related changes:
1. "Decrease `shouldRelay` limit to 30s." Pretty self-explanatory. Currently, the limit is 5 minutes, by which point the `HashRouter` entry could have expired, making this transaction look brand new (and thus causing it to be relayed back to peers which have sent it to us recently).
2.  "Give a transaction more chances to be retried." Will put a transaction into `LedgerMaster`'s held transactions if the transaction gets a `ter`, `tel`, or `tef` result. Old behavior was just `ter`.
     * Additionally, to prevent a transaction from being repeatedly held indefinitely, it must meet some extra conditions. (Documented in a comment in the code.)
3. "Pop all transactions with sequential sequences, or tickets." When a transaction is processed successfully, currently, one held transaction for the same account (if any) will be popped out of the held transactions list, and queued up for the next transaction batch. This change pops all transactions for the account, but only if they have sequential sequences (for non-ticket transactions) or use a ticket. This issue was identified from interactions with @mtrippled's #4504, which was merged, but unfortunately reverted later by #4852. When the batches were spaced out, it could potentially take a very long time for a large number of held transactions for an account to get processed through. However, whether batched or not, this change will help get held transactions cleared out, particularly if a missing earlier transaction is what held them up.
4. "Process held transactions through existing NetworkOPs batching." In the current processing, at the end of each consensus round, all held transactions are directly applied to the open ledger, then the held list is reset. This bypasses all of the logic in `NetworkOPs::apply` which, among other things, broadcasts successful transactions to peers. This means that the transaction may not get broadcast to peers for a really long time (5 minutes in the current implementation, or 30 seconds with this first commit). If the node is a bottleneck (either due to network configuration, or because the transaction was submitted locally), the transaction may not be seen by any other nodes or validators before it expires or causes other problems.
2025-05-01 13:58:18 -04:00
Vito Tumas
3502df2174 fix: Replaces random endpoint resolution with sequential (#5365)
This change addresses an issue where `rippled` attempts to connect to an IPv6 address, even when the local network lacks IPv6 support, resulting in a "Network is unreachable" error.

The fix replaces the custom endpoint selection logic with `boost::async_connect`, which sequentially attempts to connect to available endpoints until one succeeds or all fail.
2025-04-28 15:38:55 -04:00
Vlad
fa1e25abef chore: Small clarification to lsfDefaultRipple comment (#5410) 2025-04-25 15:21:27 +00:00
Denis Angell
217ba8dd4d fix: CTID to use correct ledger_index (#5408) 2025-04-24 10:24:10 -04:00
Ed Hennis
405f4613d8 chore: Run CI on PRs that are Ready or have the "DraftRunCI" label (#5400)
- Avoids costly overhead for idle PRs where the CI results don't add any
  value.
2025-04-11 22:20:59 +00:00
Mayukha Vadari
cba512068b refactor: Clean up test logging to make it easier to search (#5396)
This PR replaces the word `failed` with `failure` in any test names and renames some test files to fix MSVC warnings, so that it is easier to search through the test output to find tests that failed.
2025-04-11 09:07:42 +00:00
Valentin Balaschenko
1c99ea23d1 Temporary disable automatic triggering macOS pipeline (#5397)
We temporarily disable running unit tests on macOS on the CI pipeline while we are investigating the delays.
2025-04-10 21:58:29 +02:00
Denis Angell
c4308b216f fix: Adds CTID to RPC tx and updates error (#4738)
This change fixes a number of issues involved with CTID:
* CTID is not present on all RPC tx transactions.
* rpcWRONG_NETWORK is missing in the ErrorCodes.cpp
2025-04-10 12:38:52 +00:00
Wietse Wind
aafd2d8525 Fix: admin RPC webhook queue limit removal and timeout reduction (#5163)
When using subscribe at admin RPC port to send webhooks for the transaction stream to a backend, on large(r) ledgers the endpoint receives fewer HTTP POSTs with TX information than the amount of transactions in a ledger. This change removes the hardcoded queue length to avoid dropping TX notifications for the admin-only command. In addition, the per-request TTL for outgoing RPC HTTP calls has been reduced from 10 minutes to 30 seconds.
2025-04-10 06:37:24 +00:00
Denis Angell
a574ec6023 fix: fixPayChanV1 (#4717)
This change introduces a new fix amendment (`fixPayChanV1`) that prevents the creation of new `PaymentChannelCreate` transaction with a `CancelAfter` time less than the current ledger time. It piggy backs off of fix1571.

Once the amendment is activated, creating a new `PaymentChannel` will require that if you specify the `CancelAfter` time/value, that value must be greater than or equal to the current ledger time.

Currently users can create a payment channel where the `CancelAfter` time is before the current ledger time. This results in the payment channel being immediately closed on the next PaymentChannel transaction.
2025-04-09 22:08:44 +00:00
Mayukha Vadari
e429455f4d refactor(trivial): reorganize ledger entry tests and helper functions (#5376)
This PR splits out `ledger_entry` tests into its own file (`LedgerEntry_test.cpp`) and alphabetizes the helper functions in `LedgerEntry.cpp`. These commits were split out of #5237 to make that PR a little more manageable, since these basic trivial changes are most of the diff. There is no code change, just moving code around.
2025-04-09 17:02:03 +00:00
Vito Tumas
7692eeb9a0 Instrument proposal, validation and transaction messages (#5348)
Adds metric counters for the following P2P message types:

* Untrusted proposal and validation messages
* Duplicate proposal, validation and transaction messages
2025-04-09 15:33:17 +02:00
Bronek Kozicki
a099f5a804 Remove UNREACHABLE from NetworkOPsImp::processTrustedProposal (#5387)
It’s possible for this to happen legitimately if a set of peers, including a validator, are connected in a cycle, and the latency and message processing time between those peers is significantly less than the latency between the validator and the last peer. It’s unlikely in the real world, but obviously easy to simulate with Antithesis.
2025-04-08 14:43:34 +00:00
Michael Legleux
ca0bc767fe fix: Use the build image from ghcr.io (#5390)
The ci pipelines are constantly hitting Docker Hub's public rate limiting since increasing the number of jobs we're running. This change switches over to images hosted in GitHub's registry.
2025-04-05 02:24:31 +00:00
Mayukha Vadari
4ba9288935 fix: disable channel_authorize when signing_support is disabled (#5385) 2025-04-05 01:08:34 +00:00
Valentin Balaschenko
e923ec6d36 Fix to correct memory ordering for compare_exchange_weak and wait in the intrusive reference counting logic (#5381)
This change addresses a memory ordering assertion failure observed on one of the Windows test machines during the IntrusiveShared_test suite.
2025-04-04 18:21:17 +00:00
Vlad
851d99d99e fix: uint128 ambiguousness breaking macos unity build (#5386) 2025-04-04 08:28:33 -04:00
328 changed files with 11680 additions and 5447 deletions

View File

@@ -94,3 +94,4 @@ SpacesInSquareBrackets: false
Standard: Cpp11 Standard: Cpp11
TabWidth: 8 TabWidth: 8
UseTab: Never UseTab: Never
QualifierAlignment: Right

8
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1,8 @@
# Allow anyone to review any change by default.
*
# Require the rpc-reviewers team to review changes to the rpc code.
include/xrpl/protocol/ @xrplf/rpc-reviewers
src/libxrpl/protocol/ @xrplf/rpc-reviewers
src/xrpld/rpc/ @xrplf/rpc-reviewers
src/xrpld/app/misc/ @xrplf/rpc-reviewers

View File

@@ -1,9 +1,13 @@
name: clang-format name: clang-format
on: [push, pull_request] on:
push:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
jobs: jobs:
check: check:
if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }}
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
env: env:
CLANG_VERSION: 18 CLANG_VERSION: 18

View File

@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: write contents: write
container: rippleci/rippled-build-ubuntu:aaf5e3e container: ghcr.io/xrplf/rippled-build-ubuntu:aaf5e3e
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v4 uses: actions/checkout@v4

View File

@@ -1,9 +1,13 @@
name: levelization name: levelization
on: [push, pull_request] on:
push:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
jobs: jobs:
check: check:
if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
CLANG_VERSION: 10 CLANG_VERSION: 10

View File

@@ -8,19 +8,21 @@ on:
paths: paths:
- 'src/libxrpl/protocol/BuildInfo.cpp' - 'src/libxrpl/protocol/BuildInfo.cpp'
- '.github/workflows/libxrpl.yml' - '.github/workflows/libxrpl.yml'
types: [opened, reopened, synchronize, ready_for_review]
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
publish: publish:
if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }}
name: Publish libXRPL name: Publish libXRPL
outputs: outputs:
outcome: ${{ steps.upload.outputs.outcome }} outcome: ${{ steps.upload.outputs.outcome }}
version: ${{ steps.version.outputs.version }} version: ${{ steps.version.outputs.version }}
channel: ${{ steps.channel.outputs.channel }} channel: ${{ steps.channel.outputs.channel }}
runs-on: [self-hosted, heavy] runs-on: [self-hosted, heavy]
container: rippleci/rippled-build-ubuntu:aaf5e3e container: ghcr.io/xrplf/rippled-build-ubuntu:aaf5e3e
steps: steps:
- name: Wait for essential checks to succeed - name: Wait for essential checks to succeed
uses: lewagon/wait-on-check-action@v1.3.4 uses: lewagon/wait-on-check-action@v1.3.4

View File

@@ -1,6 +1,7 @@
name: macos name: macos
on: on:
pull_request: pull_request:
types: [opened, reopened, synchronize, ready_for_review]
push: push:
# If the branches list is ever changed, be sure to change it on all # If the branches list is ever changed, be sure to change it on all
# build/test jobs (nix, macos, windows, instrumentation) # build/test jobs (nix, macos, windows, instrumentation)
@@ -18,6 +19,7 @@ concurrency:
jobs: jobs:
test: test:
if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }}
strategy: strategy:
matrix: matrix:
platform: platform:
@@ -69,6 +71,9 @@ jobs:
nproc --version nproc --version
echo -n "nproc returns: " echo -n "nproc returns: "
nproc nproc
system_profiler SPHardwareDataType
sysctl -n hw.logicalcpu
clang --version
- name: configure Conan - name: configure Conan
run : | run : |
conan profile new default --detect || true conan profile new default --detect || true

View File

@@ -1,6 +1,7 @@
name: nix name: nix
on: on:
pull_request: pull_request:
types: [opened, reopened, synchronize, ready_for_review]
push: push:
# If the branches list is ever changed, be sure to change it on all # If the branches list is ever changed, be sure to change it on all
# build/test jobs (nix, macos, windows) # build/test jobs (nix, macos, windows)
@@ -39,6 +40,7 @@ concurrency:
jobs: jobs:
dependencies: dependencies:
if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@@ -62,7 +64,7 @@ jobs:
cc: /usr/bin/clang-14 cc: /usr/bin/clang-14
cxx: /usr/bin/clang++-14 cxx: /usr/bin/clang++-14
runs-on: [self-hosted, heavy] runs-on: [self-hosted, heavy]
container: rippleci/rippled-build-ubuntu:aaf5e3e container: ghcr.io/xrplf/rippled-build-ubuntu:aaf5e3e
env: env:
build_dir: .build build_dir: .build
steps: steps:
@@ -124,7 +126,7 @@ jobs:
- "-Dunity=ON" - "-Dunity=ON"
needs: dependencies needs: dependencies
runs-on: [self-hosted, heavy] runs-on: [self-hosted, heavy]
container: rippleci/rippled-build-ubuntu:aaf5e3e container: ghcr.io/xrplf/rippled-build-ubuntu:aaf5e3e
env: env:
build_dir: .build build_dir: .build
steps: steps:
@@ -178,7 +180,7 @@ jobs:
- "-DUNIT_TEST_REFERENCE_FEE=1000" - "-DUNIT_TEST_REFERENCE_FEE=1000"
needs: dependencies needs: dependencies
runs-on: [self-hosted, heavy] runs-on: [self-hosted, heavy]
container: rippleci/rippled-build-ubuntu:aaf5e3e container: ghcr.io/xrplf/rippled-build-ubuntu:aaf5e3e
env: env:
build_dir: .build build_dir: .build
steps: steps:
@@ -229,7 +231,7 @@ jobs:
- Debug - Debug
needs: dependencies needs: dependencies
runs-on: [self-hosted, heavy] runs-on: [self-hosted, heavy]
container: rippleci/rippled-build-ubuntu:aaf5e3e container: ghcr.io/xrplf/rippled-build-ubuntu:aaf5e3e
env: env:
build_dir: .build build_dir: .build
steps: steps:
@@ -245,7 +247,7 @@ jobs:
mkdir -p ~/.conan mkdir -p ~/.conan
tar -xzf conan.tar -C ~/.conan tar -xzf conan.tar -C ~/.conan
- name: install gcovr - name: install gcovr
run: pip install "gcovr>=7,<8" run: pip install "gcovr>=7,<9"
- name: check environment - name: check environment
run: | run: |
echo ${PATH} | tr ':' '\n' echo ${PATH} | tr ':' '\n'
@@ -303,7 +305,7 @@ jobs:
conan: conan:
needs: dependencies needs: dependencies
runs-on: [self-hosted, heavy] runs-on: [self-hosted, heavy]
container: rippleci/rippled-build-ubuntu:aaf5e3e container: ghcr.io/xrplf/rippled-build-ubuntu:aaf5e3e
env: env:
build_dir: .build build_dir: .build
configuration: Release configuration: Release
@@ -358,6 +360,7 @@ jobs:
# later # later
instrumentation-build: instrumentation-build:
if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }}
env: env:
CLANG_RELEASE: 16 CLANG_RELEASE: 16
strategy: strategy:

View File

@@ -2,6 +2,7 @@ name: windows
on: on:
pull_request: pull_request:
types: [opened, reopened, synchronize, ready_for_review]
push: push:
# If the branches list is ever changed, be sure to change it on all # If the branches list is ever changed, be sure to change it on all
# build/test jobs (nix, macos, windows, instrumentation) # build/test jobs (nix, macos, windows, instrumentation)
@@ -21,6 +22,7 @@ concurrency:
jobs: jobs:
test: test:
if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:

View File

@@ -83,9 +83,17 @@ The [commandline](https://xrpl.org/docs/references/http-websocket-apis/api-conve
The `network_id` field was added in the `server_info` response in version 1.5.0 (2019), but it is not returned in [reporting mode](https://xrpl.org/rippled-server-modes.html#reporting-mode). However, use of reporting mode is now discouraged, in favor of using [Clio](https://github.com/XRPLF/clio) instead. The `network_id` field was added in the `server_info` response in version 1.5.0 (2019), but it is not returned in [reporting mode](https://xrpl.org/rippled-server-modes.html#reporting-mode). However, use of reporting mode is now discouraged, in favor of using [Clio](https://github.com/XRPLF/clio) instead.
## XRP Ledger server version 2.5.0
As of 2025-04-04, version 2.5.0 is in development. You can use a pre-release version by building from source or [using the `nightly` package](https://xrpl.org/docs/infrastructure/installation/install-rippled-on-ubuntu).
### Additions and bugfixes in 2.5.0
- `channel_authorize`: If `signing_support` is not enabled in the config, the RPC is disabled.
## XRP Ledger server version 2.4.0 ## XRP Ledger server version 2.4.0
As of 2025-01-28, version 2.4.0 is in development. You can use a pre-release version by building from source or [using the `nightly` package](https://xrpl.org/docs/infrastructure/installation/install-rippled-on-ubuntu). [Version 2.4.0](https://github.com/XRPLF/rippled/releases/tag/2.4.0) was released on March 4, 2025.
### Additions and bugfixes in 2.4.0 ### Additions and bugfixes in 2.4.0

View File

@@ -29,7 +29,7 @@ Loop: xrpld.core xrpld.net
xrpld.net > xrpld.core xrpld.net > xrpld.core
Loop: xrpld.core xrpld.perflog Loop: xrpld.core xrpld.perflog
xrpld.perflog == xrpld.core xrpld.perflog ~= xrpld.core
Loop: xrpld.net xrpld.rpc Loop: xrpld.net xrpld.rpc
xrpld.rpc ~= xrpld.net xrpld.rpc ~= xrpld.net

View File

@@ -162,6 +162,7 @@ xrpld.ledger > xrpl.basics
xrpld.ledger > xrpl.json xrpld.ledger > xrpl.json
xrpld.ledger > xrpl.protocol xrpld.ledger > xrpl.protocol
xrpld.net > xrpl.basics xrpld.net > xrpl.basics
xrpld.net > xrpld.perflog
xrpld.net > xrpl.json xrpld.net > xrpl.json
xrpld.net > xrpl.protocol xrpld.net > xrpl.protocol
xrpld.net > xrpl.resource xrpld.net > xrpl.resource

View File

@@ -26,7 +26,7 @@
# #
# Examples: # Examples:
# https://vl.ripple.com # https://vl.ripple.com
# https://vl.xrplf.org # https://unl.xrplf.org
# http://127.0.0.1:8000 # http://127.0.0.1:8000
# file:///etc/opt/ripple/vl.txt # file:///etc/opt/ripple/vl.txt
# #

View File

@@ -98,6 +98,9 @@
# 2024-04-03, Bronek Kozicki # 2024-04-03, Bronek Kozicki
# - add support for output formats: jacoco, clover, lcov # - add support for output formats: jacoco, clover, lcov
# #
# 2025-05-12, Jingchen Wu
# - add -fprofile-update=atomic to ensure atomic profile generation
#
# USAGE: # USAGE:
# #
# 1. Copy this file into your cmake modules path. # 1. Copy this file into your cmake modules path.
@@ -200,15 +203,27 @@ set(COVERAGE_COMPILER_FLAGS "-g --coverage"
CACHE INTERNAL "") CACHE INTERNAL "")
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
include(CheckCCompilerFlag)
check_cxx_compiler_flag(-fprofile-abs-path HAVE_cxx_fprofile_abs_path) check_cxx_compiler_flag(-fprofile-abs-path HAVE_cxx_fprofile_abs_path)
if(HAVE_cxx_fprofile_abs_path) if(HAVE_cxx_fprofile_abs_path)
set(COVERAGE_CXX_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-abs-path") set(COVERAGE_CXX_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-abs-path")
endif() endif()
include(CheckCCompilerFlag)
check_c_compiler_flag(-fprofile-abs-path HAVE_c_fprofile_abs_path) check_c_compiler_flag(-fprofile-abs-path HAVE_c_fprofile_abs_path)
if(HAVE_c_fprofile_abs_path) if(HAVE_c_fprofile_abs_path)
set(COVERAGE_C_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-abs-path") set(COVERAGE_C_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-abs-path")
endif() endif()
check_cxx_compiler_flag(-fprofile-update HAVE_cxx_fprofile_update)
if(HAVE_cxx_fprofile_update)
set(COVERAGE_CXX_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-update=atomic")
endif()
check_c_compiler_flag(-fprofile-update HAVE_c_fprofile_update)
if(HAVE_c_fprofile_update)
set(COVERAGE_C_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-update=atomic")
endif()
endif() endif()
set(CMAKE_Fortran_FLAGS_COVERAGE set(CMAKE_Fortran_FLAGS_COVERAGE

View File

@@ -367,7 +367,7 @@ get(Section const& section,
} }
inline std::string inline std::string
get(Section const& section, std::string const& name, const char* defaultValue) get(Section const& section, std::string const& name, char const* defaultValue)
{ {
try try
{ {

View File

@@ -55,7 +55,7 @@ lz4Compress(void const* in, std::size_t inSize, BufferFactory&& bf)
auto compressed = bf(outCapacity); auto compressed = bf(outCapacity);
auto compressedSize = LZ4_compress_default( auto compressedSize = LZ4_compress_default(
reinterpret_cast<const char*>(in), reinterpret_cast<char const*>(in),
reinterpret_cast<char*>(compressed), reinterpret_cast<char*>(compressed),
inSize, inSize,
outCapacity); outCapacity);
@@ -89,7 +89,7 @@ lz4Decompress(
Throw<std::runtime_error>("lz4Decompress: integer overflow (output)"); Throw<std::runtime_error>("lz4Decompress: integer overflow (output)");
if (LZ4_decompress_safe( if (LZ4_decompress_safe(
reinterpret_cast<const char*>(in), reinterpret_cast<char const*>(in),
reinterpret_cast<char*>(decompressed), reinterpret_cast<char*>(decompressed),
inSize, inSize,
decompressedSize) != decompressedSize) decompressedSize) != decompressedSize)

View File

@@ -93,7 +93,7 @@ public:
{ {
} }
constexpr const E& constexpr E const&
value() const& value() const&
{ {
return val_; return val_;
@@ -111,7 +111,7 @@ public:
return std::move(val_); return std::move(val_);
} }
constexpr const E&& constexpr E const&&
value() const&& value() const&&
{ {
return std::move(val_); return std::move(val_);

View File

@@ -294,7 +294,7 @@ IntrusiveRefCounts::releaseStrongRef() const
} }
if (refCounts.compare_exchange_weak( if (refCounts.compare_exchange_weak(
prevIntVal, nextIntVal, std::memory_order_release)) prevIntVal, nextIntVal, std::memory_order_acq_rel))
{ {
// Can't be in partial destroy because only decrementing the strong // Can't be in partial destroy because only decrementing the strong
// count to zero can start a partial destroy, and that can't happen // count to zero can start a partial destroy, and that can't happen
@@ -351,7 +351,7 @@ IntrusiveRefCounts::addWeakReleaseStrongRef() const
} }
} }
if (refCounts.compare_exchange_weak( if (refCounts.compare_exchange_weak(
prevIntVal, nextIntVal, std::memory_order_release)) prevIntVal, nextIntVal, std::memory_order_acq_rel))
{ {
XRPL_ASSERT( XRPL_ASSERT(
(!(prevIntVal & partialDestroyStartedMask)), (!(prevIntVal & partialDestroyStartedMask)),
@@ -374,7 +374,7 @@ IntrusiveRefCounts::releaseWeakRef() const
// This case should only be hit if the partialDestroyStartedBit is // This case should only be hit if the partialDestroyStartedBit is
// set non-atomically (and even then very rarely). The code is kept // set non-atomically (and even then very rarely). The code is kept
// in case we need to set the flag non-atomically for perf reasons. // in case we need to set the flag non-atomically for perf reasons.
refCounts.wait(prevIntVal, std::memory_order_acq_rel); refCounts.wait(prevIntVal, std::memory_order_acquire);
prevIntVal = refCounts.load(std::memory_order_acquire); prevIntVal = refCounts.load(std::memory_order_acquire);
prev = RefCountPair{prevIntVal}; prev = RefCountPair{prevIntVal};
} }
@@ -382,7 +382,7 @@ IntrusiveRefCounts::releaseWeakRef() const
{ {
// partial destroy MUST finish before running a full destroy (when // partial destroy MUST finish before running a full destroy (when
// using weak pointers) // using weak pointers)
refCounts.wait(prevIntVal - weakDelta, std::memory_order_acq_rel); refCounts.wait(prevIntVal - weakDelta, std::memory_order_acquire);
} }
return ReleaseWeakRefAction::destroy; return ReleaseWeakRefAction::destroy;
} }
@@ -396,7 +396,7 @@ IntrusiveRefCounts::checkoutStrongRefFromWeak() const noexcept
auto desiredValue = RefCountPair{2, 1}.combinedValue(); auto desiredValue = RefCountPair{2, 1}.combinedValue();
while (!refCounts.compare_exchange_weak( while (!refCounts.compare_exchange_weak(
curValue, desiredValue, std::memory_order_release)) curValue, desiredValue, std::memory_order_acq_rel))
{ {
RefCountPair const prev{curValue}; RefCountPair const prev{curValue};
if (!prev.strong) if (!prev.strong)

View File

@@ -115,7 +115,7 @@ public:
sweep(); sweep();
bool bool
del(const key_type& key, bool valid); del(key_type const& key, bool valid);
public: public:
/** Replace aliased objects with originals. /** Replace aliased objects with originals.
@@ -134,20 +134,20 @@ public:
template <class R> template <class R>
bool bool
canonicalize( canonicalize(
const key_type& key, key_type const& key,
SharedPointerType& data, SharedPointerType& data,
R&& replaceCallback); R&& replaceCallback);
bool bool
canonicalize_replace_cache( canonicalize_replace_cache(
const key_type& key, key_type const& key,
SharedPointerType const& data); SharedPointerType const& data);
bool bool
canonicalize_replace_client(const key_type& key, SharedPointerType& data); canonicalize_replace_client(key_type const& key, SharedPointerType& data);
SharedPointerType SharedPointerType
fetch(const key_type& key); fetch(key_type const& key);
/** Insert the element into the container. /** Insert the element into the container.
If the key already exists, nothing happens. If the key already exists, nothing happens.
@@ -168,7 +168,7 @@ public:
// simply return an iterator. // simply return an iterator.
// //
bool bool
retrieve(const key_type& key, T& data); retrieve(key_type const& key, T& data);
mutex_type& mutex_type&
peekMutex(); peekMutex();
@@ -322,10 +322,10 @@ private:
std::string m_name; std::string m_name;
// Desired number of cache entries (0 = ignore) // Desired number of cache entries (0 = ignore)
const int m_target_size; int const m_target_size;
// Desired maximum cache age // Desired maximum cache age
const clock_type::duration m_target_age; clock_type::duration const m_target_age;
// Number of items cached // Number of items cached
int m_cache_count; int m_cache_count;

View File

@@ -365,7 +365,7 @@ TaggedCache<
SharedPointerType, SharedPointerType,
Hash, Hash,
KeyEqual, KeyEqual,
Mutex>::del(const key_type& key, bool valid) Mutex>::del(key_type const& key, bool valid)
{ {
// Remove from cache, if !valid, remove from map too. Returns true if // Remove from cache, if !valid, remove from map too. Returns true if
// removed from cache // removed from cache
@@ -414,7 +414,7 @@ TaggedCache<
KeyEqual, KeyEqual,
Mutex>:: Mutex>::
canonicalize( canonicalize(
const key_type& key, key_type const& key,
SharedPointerType& data, SharedPointerType& data,
R&& replaceCallback) R&& replaceCallback)
{ {
@@ -509,7 +509,7 @@ TaggedCache<
KeyEqual, KeyEqual,
Mutex>:: Mutex>::
canonicalize_replace_cache( canonicalize_replace_cache(
const key_type& key, key_type const& key,
SharedPointerType const& data) SharedPointerType const& data)
{ {
return canonicalize( return canonicalize(
@@ -535,7 +535,7 @@ TaggedCache<
Hash, Hash,
KeyEqual, KeyEqual,
Mutex>:: Mutex>::
canonicalize_replace_client(const key_type& key, SharedPointerType& data) canonicalize_replace_client(key_type const& key, SharedPointerType& data)
{ {
return canonicalize(key, data, []() { return false; }); return canonicalize(key, data, []() { return false; });
} }
@@ -558,7 +558,7 @@ TaggedCache<
SharedPointerType, SharedPointerType,
Hash, Hash,
KeyEqual, KeyEqual,
Mutex>::fetch(const key_type& key) Mutex>::fetch(key_type const& key)
{ {
std::lock_guard<mutex_type> l(m_mutex); std::lock_guard<mutex_type> l(m_mutex);
auto ret = initialFetch(key, l); auto ret = initialFetch(key, l);
@@ -656,7 +656,7 @@ TaggedCache<
SharedPointerType, SharedPointerType,
Hash, Hash,
KeyEqual, KeyEqual,
Mutex>::retrieve(const key_type& key, T& data) Mutex>::retrieve(key_type const& key, T& data)
{ {
// retrieve the value of the stored data // retrieve the value of the stored data
auto entry = fetch(key); auto entry = fetch(key);

View File

@@ -374,7 +374,7 @@ public:
} }
base_uint& base_uint&
operator^=(const base_uint& b) operator^=(base_uint const& b)
{ {
for (int i = 0; i < WIDTH; i++) for (int i = 0; i < WIDTH; i++)
data_[i] ^= b.data_[i]; data_[i] ^= b.data_[i];
@@ -383,7 +383,7 @@ public:
} }
base_uint& base_uint&
operator&=(const base_uint& b) operator&=(base_uint const& b)
{ {
for (int i = 0; i < WIDTH; i++) for (int i = 0; i < WIDTH; i++)
data_[i] &= b.data_[i]; data_[i] &= b.data_[i];
@@ -392,7 +392,7 @@ public:
} }
base_uint& base_uint&
operator|=(const base_uint& b) operator|=(base_uint const& b)
{ {
for (int i = 0; i < WIDTH; i++) for (int i = 0; i < WIDTH; i++)
data_[i] |= b.data_[i]; data_[i] |= b.data_[i];
@@ -415,11 +415,11 @@ public:
return *this; return *this;
} }
const base_uint base_uint const
operator++(int) operator++(int)
{ {
// postfix operator // postfix operator
const base_uint ret = *this; base_uint const ret = *this;
++(*this); ++(*this);
return ret; return ret;
@@ -441,11 +441,11 @@ public:
return *this; return *this;
} }
const base_uint base_uint const
operator--(int) operator--(int)
{ {
// postfix operator // postfix operator
const base_uint ret = *this; base_uint const ret = *this;
--(*this); --(*this);
return ret; return ret;
@@ -466,7 +466,7 @@ public:
} }
base_uint& base_uint&
operator+=(const base_uint& b) operator+=(base_uint const& b)
{ {
std::uint64_t carry = 0; std::uint64_t carry = 0;
@@ -511,7 +511,7 @@ public:
} }
[[nodiscard]] constexpr bool [[nodiscard]] constexpr bool
parseHex(const char* str) parseHex(char const* str)
{ {
return parseHex(std::string_view{str}); return parseHex(std::string_view{str});
} }

View File

@@ -43,7 +43,7 @@ struct less
using result_type = bool; using result_type = bool;
constexpr bool constexpr bool
operator()(const T& left, const T& right) const operator()(T const& left, T const& right) const
{ {
return std::less<T>()(left, right); return std::less<T>()(left, right);
} }
@@ -55,7 +55,7 @@ struct equal_to
using result_type = bool; using result_type = bool;
constexpr bool constexpr bool
operator()(const T& left, const T& right) const operator()(T const& left, T const& right) const
{ {
return std::equal_to<T>()(left, right); return std::equal_to<T>()(left, right);
} }

View File

@@ -52,7 +52,7 @@ template <
typename Value, typename Value,
typename Hash, typename Hash,
typename Pred = std::equal_to<Key>, typename Pred = std::equal_to<Key>,
typename Alloc = std::allocator<std::pair<const Key, Value>>> typename Alloc = std::allocator<std::pair<Key const, Value>>>
class partitioned_unordered_map class partitioned_unordered_map
{ {
std::size_t partitions_; std::size_t partitions_;

View File

@@ -76,13 +76,13 @@ public:
} }
bool bool
operator<(const tagged_integer& rhs) const noexcept operator<(tagged_integer const& rhs) const noexcept
{ {
return m_value < rhs.m_value; return m_value < rhs.m_value;
} }
bool bool
operator==(const tagged_integer& rhs) const noexcept operator==(tagged_integer const& rhs) const noexcept
{ {
return m_value == rhs.m_value; return m_value == rhs.m_value;
} }
@@ -144,14 +144,14 @@ public:
} }
tagged_integer& tagged_integer&
operator<<=(const tagged_integer& rhs) noexcept operator<<=(tagged_integer const& rhs) noexcept
{ {
m_value <<= rhs.m_value; m_value <<= rhs.m_value;
return *this; return *this;
} }
tagged_integer& tagged_integer&
operator>>=(const tagged_integer& rhs) noexcept operator>>=(tagged_integer const& rhs) noexcept
{ {
m_value >>= rhs.m_value; m_value >>= rhs.m_value;
return *this; return *this;

View File

@@ -37,9 +37,9 @@ class temp_dir
public: public:
#if !GENERATING_DOCS #if !GENERATING_DOCS
temp_dir(const temp_dir&) = delete; temp_dir(temp_dir const&) = delete;
temp_dir& temp_dir&
operator=(const temp_dir&) = delete; operator=(temp_dir const&) = delete;
#endif #endif
/// Construct a temporary directory. /// Construct a temporary directory.

View File

@@ -39,7 +39,7 @@ class Reader
{ {
public: public:
using Char = char; using Char = char;
using Location = const Char*; using Location = Char const*;
/** \brief Constructs a Reader allowing all features /** \brief Constructs a Reader allowing all features
* for parsing. * for parsing.
@@ -64,7 +64,7 @@ public:
* error occurred. * error occurred.
*/ */
bool bool
parse(const char* beginDoc, const char* endDoc, Value& root); parse(char const* beginDoc, char const* endDoc, Value& root);
/// \brief Parse from input stream. /// \brief Parse from input stream.
/// \see Json::operator>>(std::istream&, Json::Value&). /// \see Json::operator>>(std::istream&, Json::Value&).
@@ -133,7 +133,7 @@ private:
using Errors = std::deque<ErrorInfo>; using Errors = std::deque<ErrorInfo>;
bool bool
expectToken(TokenType type, Token& token, const char* message); expectToken(TokenType type, Token& token, char const* message);
bool bool
readToken(Token& token); readToken(Token& token);
void void

View File

@@ -63,24 +63,24 @@ enum ValueType {
class StaticString class StaticString
{ {
public: public:
constexpr explicit StaticString(const char* czstring) : str_(czstring) constexpr explicit StaticString(char const* czstring) : str_(czstring)
{ {
} }
constexpr constexpr
operator const char*() const operator char const*() const
{ {
return str_; return str_;
} }
constexpr const char* constexpr char const*
c_str() const c_str() const
{ {
return str_; return str_;
} }
private: private:
const char* str_; char const* str_;
}; };
inline bool inline bool
@@ -158,10 +158,10 @@ public:
using Int = Json::Int; using Int = Json::Int;
using ArrayIndex = UInt; using ArrayIndex = UInt;
static const Value null; static Value const null;
static const Int minInt; static Int const minInt;
static const Int maxInt; static Int const maxInt;
static const UInt maxUInt; static UInt const maxUInt;
private: private:
class CZString class CZString
@@ -173,24 +173,24 @@ private:
duplicateOnCopy duplicateOnCopy
}; };
CZString(int index); CZString(int index);
CZString(const char* cstr, DuplicationPolicy allocate); CZString(char const* cstr, DuplicationPolicy allocate);
CZString(const CZString& other); CZString(CZString const& other);
~CZString(); ~CZString();
CZString& CZString&
operator=(const CZString& other) = delete; operator=(CZString const& other) = delete;
bool bool
operator<(const CZString& other) const; operator<(CZString const& other) const;
bool bool
operator==(const CZString& other) const; operator==(CZString const& other) const;
int int
index() const; index() const;
const char* char const*
c_str() const; c_str() const;
bool bool
isStaticString() const; isStaticString() const;
private: private:
const char* cstr_; char const* cstr_;
int index_; int index_;
}; };
@@ -217,7 +217,7 @@ public:
Value(Int value); Value(Int value);
Value(UInt value); Value(UInt value);
Value(double value); Value(double value);
Value(const char* value); Value(char const* value);
Value(ripple::Number const& value); Value(ripple::Number const& value);
/** \brief Constructs a value from a static string. /** \brief Constructs a value from a static string.
@@ -230,10 +230,10 @@ public:
* Json::Value aValue( StaticString("some text") ); * Json::Value aValue( StaticString("some text") );
* \endcode * \endcode
*/ */
Value(const StaticString& value); Value(StaticString const& value);
Value(std::string const& value); Value(std::string const& value);
Value(bool value); Value(bool value);
Value(const Value& other); Value(Value const& other);
~Value(); ~Value();
Value& Value&
@@ -250,7 +250,7 @@ public:
ValueType ValueType
type() const; type() const;
const char* char const*
asCString() const; asCString() const;
/** Returns the unquoted string value. */ /** Returns the unquoted string value. */
std::string std::string
@@ -320,12 +320,12 @@ public:
/// Access an array element (zero based index ) /// Access an array element (zero based index )
/// (You may need to say 'value[0u]' to get your compiler to distinguish /// (You may need to say 'value[0u]' to get your compiler to distinguish
/// this from the operator[] which takes a string.) /// this from the operator[] which takes a string.)
const Value& Value const&
operator[](UInt index) const; operator[](UInt index) const;
/// If the array contains at least index+1 elements, returns the element /// If the array contains at least index+1 elements, returns the element
/// value, otherwise returns defaultValue. /// value, otherwise returns defaultValue.
Value Value
get(UInt index, const Value& defaultValue) const; get(UInt index, Value const& defaultValue) const;
/// Return true if index < size(). /// Return true if index < size().
bool bool
isValidIndex(UInt index) const; isValidIndex(UInt index) const;
@@ -333,25 +333,25 @@ public:
/// ///
/// Equivalent to jsonvalue[jsonvalue.size()] = value; /// Equivalent to jsonvalue[jsonvalue.size()] = value;
Value& Value&
append(const Value& value); append(Value const& value);
Value& Value&
append(Value&& value); append(Value&& value);
/// Access an object value by name, create a null member if it does not /// Access an object value by name, create a null member if it does not
/// exist. /// exist.
Value& Value&
operator[](const char* key); operator[](char const* key);
/// Access an object value by name, returns null if there is no member with /// Access an object value by name, returns null if there is no member with
/// that name. /// that name.
const Value& Value const&
operator[](const char* key) const; operator[](char const* key) const;
/// Access an object value by name, create a null member if it does not /// Access an object value by name, create a null member if it does not
/// exist. /// exist.
Value& Value&
operator[](std::string const& key); operator[](std::string const& key);
/// Access an object value by name, returns null if there is no member with /// Access an object value by name, returns null if there is no member with
/// that name. /// that name.
const Value& Value const&
operator[](std::string const& key) const; operator[](std::string const& key) const;
/** \brief Access an object value by name, create a null member if it does /** \brief Access an object value by name, create a null member if it does
not exist. not exist.
@@ -367,16 +367,16 @@ public:
* \endcode * \endcode
*/ */
Value& Value&
operator[](const StaticString& key); operator[](StaticString const& key);
Value const& Value const&
operator[](const StaticString& key) const; operator[](StaticString const& key) const;
/// Return the member named key if it exist, defaultValue otherwise. /// Return the member named key if it exist, defaultValue otherwise.
Value Value
get(const char* key, const Value& defaultValue) const; get(char const* key, Value const& defaultValue) const;
/// Return the member named key if it exist, defaultValue otherwise. /// Return the member named key if it exist, defaultValue otherwise.
Value Value
get(std::string const& key, const Value& defaultValue) const; get(std::string const& key, Value const& defaultValue) const;
/// \brief Remove and return the named member. /// \brief Remove and return the named member.
/// ///
@@ -385,14 +385,14 @@ public:
/// \pre type() is objectValue or nullValue /// \pre type() is objectValue or nullValue
/// \post type() is unchanged /// \post type() is unchanged
Value Value
removeMember(const char* key); removeMember(char const* key);
/// Same as removeMember(const char*) /// Same as removeMember(const char*)
Value Value
removeMember(std::string const& key); removeMember(std::string const& key);
/// Return true if the object has a member named key. /// Return true if the object has a member named key.
bool bool
isMember(const char* key) const; isMember(char const* key) const;
/// Return true if the object has a member named key. /// Return true if the object has a member named key.
bool bool
isMember(std::string const& key) const; isMember(std::string const& key) const;
@@ -419,13 +419,13 @@ public:
end(); end();
friend bool friend bool
operator==(const Value&, const Value&); operator==(Value const&, Value const&);
friend bool friend bool
operator<(const Value&, const Value&); operator<(Value const&, Value const&);
private: private:
Value& Value&
resolveReference(const char* key, bool isStatic); resolveReference(char const* key, bool isStatic);
private: private:
union ValueHolder union ValueHolder
@@ -448,31 +448,31 @@ to_json(ripple::Number const& number)
} }
bool bool
operator==(const Value&, const Value&); operator==(Value const&, Value const&);
inline bool inline bool
operator!=(const Value& x, const Value& y) operator!=(Value const& x, Value const& y)
{ {
return !(x == y); return !(x == y);
} }
bool bool
operator<(const Value&, const Value&); operator<(Value const&, Value const&);
inline bool inline bool
operator<=(const Value& x, const Value& y) operator<=(Value const& x, Value const& y)
{ {
return !(y < x); return !(y < x);
} }
inline bool inline bool
operator>(const Value& x, const Value& y) operator>(Value const& x, Value const& y)
{ {
return y < x; return y < x;
} }
inline bool inline bool
operator>=(const Value& x, const Value& y) operator>=(Value const& x, Value const& y)
{ {
return !(x < y); return !(x < y);
} }
@@ -493,11 +493,11 @@ public:
virtual ~ValueAllocator() = default; virtual ~ValueAllocator() = default;
virtual char* virtual char*
makeMemberName(const char* memberName) = 0; makeMemberName(char const* memberName) = 0;
virtual void virtual void
releaseMemberName(char* memberName) = 0; releaseMemberName(char* memberName) = 0;
virtual char* virtual char*
duplicateStringValue(const char* value, unsigned int length = unknown) = 0; duplicateStringValue(char const* value, unsigned int length = unknown) = 0;
virtual void virtual void
releaseStringValue(char* value) = 0; releaseStringValue(char* value) = 0;
}; };
@@ -514,16 +514,16 @@ public:
ValueIteratorBase(); ValueIteratorBase();
explicit ValueIteratorBase(const Value::ObjectValues::iterator& current); explicit ValueIteratorBase(Value::ObjectValues::iterator const& current);
bool bool
operator==(const SelfType& other) const operator==(SelfType const& other) const
{ {
return isEqual(other); return isEqual(other);
} }
bool bool
operator!=(const SelfType& other) const operator!=(SelfType const& other) const
{ {
return !isEqual(other); return !isEqual(other);
} }
@@ -539,7 +539,7 @@ public:
/// Return the member name of the referenced Value. "" if it is not an /// Return the member name of the referenced Value. "" if it is not an
/// objectValue. /// objectValue.
const char* char const*
memberName() const; memberName() const;
protected: protected:
@@ -553,13 +553,13 @@ protected:
decrement(); decrement();
difference_type difference_type
computeDistance(const SelfType& other) const; computeDistance(SelfType const& other) const;
bool bool
isEqual(const SelfType& other) const; isEqual(SelfType const& other) const;
void void
copy(const SelfType& other); copy(SelfType const& other);
private: private:
Value::ObjectValues::iterator current_; Value::ObjectValues::iterator current_;
@@ -577,8 +577,8 @@ class ValueConstIterator : public ValueIteratorBase
public: public:
using size_t = unsigned int; using size_t = unsigned int;
using difference_type = int; using difference_type = int;
using reference = const Value&; using reference = Value const&;
using pointer = const Value*; using pointer = Value const*;
using SelfType = ValueConstIterator; using SelfType = ValueConstIterator;
ValueConstIterator() = default; ValueConstIterator() = default;
@@ -586,11 +586,11 @@ public:
private: private:
/*! \internal Use by Value to create an iterator. /*! \internal Use by Value to create an iterator.
*/ */
explicit ValueConstIterator(const Value::ObjectValues::iterator& current); explicit ValueConstIterator(Value::ObjectValues::iterator const& current);
public: public:
SelfType& SelfType&
operator=(const ValueIteratorBase& other); operator=(ValueIteratorBase const& other);
SelfType SelfType
operator++(int) operator++(int)
@@ -643,17 +643,17 @@ public:
using SelfType = ValueIterator; using SelfType = ValueIterator;
ValueIterator() = default; ValueIterator() = default;
ValueIterator(const ValueConstIterator& other); ValueIterator(ValueConstIterator const& other);
ValueIterator(const ValueIterator& other); ValueIterator(ValueIterator const& other);
private: private:
/*! \internal Use by Value to create an iterator. /*! \internal Use by Value to create an iterator.
*/ */
explicit ValueIterator(const Value::ObjectValues::iterator& current); explicit ValueIterator(Value::ObjectValues::iterator const& current);
public: public:
SelfType& SelfType&
operator=(const SelfType& other); operator=(SelfType const& other);
SelfType SelfType
operator++(int) operator++(int)

View File

@@ -39,7 +39,7 @@ public:
{ {
} }
virtual std::string virtual std::string
write(const Value& root) = 0; write(Value const& root) = 0;
}; };
/** \brief Outputs a Value in <a HREF="http://www.json.org">JSON</a> format /** \brief Outputs a Value in <a HREF="http://www.json.org">JSON</a> format
@@ -60,11 +60,11 @@ public:
public: // overridden from Writer public: // overridden from Writer
std::string std::string
write(const Value& root) override; write(Value const& root) override;
private: private:
void void
writeValue(const Value& value); writeValue(Value const& value);
std::string document_; std::string document_;
}; };
@@ -101,15 +101,15 @@ public: // overridden from Writer
* JSON document that represents the root value. * JSON document that represents the root value.
*/ */
std::string std::string
write(const Value& root) override; write(Value const& root) override;
private: private:
void void
writeValue(const Value& value); writeValue(Value const& value);
void void
writeArrayValue(const Value& value); writeArrayValue(Value const& value);
bool bool
isMultineArray(const Value& value); isMultineArray(Value const& value);
void void
pushValue(std::string const& value); pushValue(std::string const& value);
void void
@@ -168,15 +168,15 @@ public:
* return a value. * return a value.
*/ */
void void
write(std::ostream& out, const Value& root); write(std::ostream& out, Value const& root);
private: private:
void void
writeValue(const Value& value); writeValue(Value const& value);
void void
writeArrayValue(const Value& value); writeArrayValue(Value const& value);
bool bool
isMultineArray(const Value& value); isMultineArray(Value const& value);
void void
pushValue(std::string const& value); pushValue(std::string const& value);
void void
@@ -207,12 +207,12 @@ valueToString(double value);
std::string std::string
valueToString(bool value); valueToString(bool value);
std::string std::string
valueToQuotedString(const char* value); valueToQuotedString(char const* value);
/// \brief Output using the StyledStreamWriter. /// \brief Output using the StyledStreamWriter.
/// \see Json::operator>>() /// \see Json::operator>>()
std::ostream& std::ostream&
operator<<(std::ostream&, const Value& root); operator<<(std::ostream&, Value const& root);
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View File

@@ -37,7 +37,7 @@ pretty(Value const&);
/** Output using the StyledStreamWriter. @see Json::operator>>(). */ /** Output using the StyledStreamWriter. @see Json::operator>>(). */
std::ostream& std::ostream&
operator<<(std::ostream&, const Value& root); operator<<(std::ostream&, Value const& root);
} // namespace Json } // namespace Json

View File

@@ -120,7 +120,7 @@ enum error_code_i {
rpcSRC_ACT_MALFORMED = 65, rpcSRC_ACT_MALFORMED = 65,
rpcSRC_ACT_MISSING = 66, rpcSRC_ACT_MISSING = 66,
rpcSRC_ACT_NOT_FOUND = 67, rpcSRC_ACT_NOT_FOUND = 67,
// unused 68, rpcDELEGATE_ACT_NOT_FOUND = 68,
rpcSRC_CUR_MALFORMED = 69, rpcSRC_CUR_MALFORMED = 69,
rpcSRC_ISR_MALFORMED = 70, rpcSRC_ISR_MALFORMED = 70,
rpcSTREAM_MALFORMED = 71, rpcSTREAM_MALFORMED = 71,

View File

@@ -336,7 +336,7 @@ public:
// Output Fees as just their numeric value. // Output Fees as just their numeric value.
template <class Char, class Traits, class UnitTag, class T> template <class Char, class Traits, class UnitTag, class T>
std::basic_ostream<Char, Traits>& std::basic_ostream<Char, Traits>&
operator<<(std::basic_ostream<Char, Traits>& os, const TaggedFee<UnitTag, T>& q) operator<<(std::basic_ostream<Char, Traits>& os, TaggedFee<UnitTag, T> const& q)
{ {
return os << q.value(); return os << q.value();
} }

View File

@@ -279,6 +279,10 @@ amm(Asset const& issue1, Asset const& issue2) noexcept;
Keylet Keylet
amm(uint256 const& amm) noexcept; amm(uint256 const& amm) noexcept;
/** A keylet for Delegate object */
Keylet
delegate(AccountID const& account, AccountID const& authorizedAccount) noexcept;
Keylet Keylet
bridge(STXChainBridge const& bridge, STXChainBridge::ChainType chainType); bridge(STXChainBridge const& bridge, STXChainBridge::ChainType chainType);

View File

@@ -132,7 +132,7 @@ enum LedgerSpecificFlags {
lsfNoFreeze = 0x00200000, // True, cannot freeze ripple states lsfNoFreeze = 0x00200000, // True, cannot freeze ripple states
lsfGlobalFreeze = 0x00400000, // True, all assets frozen lsfGlobalFreeze = 0x00400000, // True, all assets frozen
lsfDefaultRipple = lsfDefaultRipple =
0x00800000, // True, trust lines allow rippling by default 0x00800000, // True, incoming trust lines allow rippling by default
lsfDepositAuth = 0x01000000, // True, all deposits require authorization lsfDepositAuth = 0x01000000, // True, all deposits require authorization
/* // reserved for Hooks amendment /* // reserved for Hooks amendment
lsfTshCollect = 0x02000000, // True, allow TSH collect-calls to acc hooks lsfTshCollect = 0x02000000, // True, allow TSH collect-calls to acc hooks

View File

@@ -80,7 +80,7 @@ struct MultiApiJson
} }
void void
set(const char* key, auto const& v) set(char const* key, auto const& v)
requires std::constructible_from<Json::Value, decltype(v)> requires std::constructible_from<Json::Value, decltype(v)>
{ {
for (auto& a : this->val) for (auto& a : this->val)
@@ -91,7 +91,7 @@ struct MultiApiJson
enum IsMemberResult : int { none = 0, some, all }; enum IsMemberResult : int { none = 0, some, all };
[[nodiscard]] IsMemberResult [[nodiscard]] IsMemberResult
isMember(const char* key) const isMember(char const* key) const
{ {
int count = 0; int count = 0;
for (auto& a : this->val) for (auto& a : this->val)

View File

@@ -0,0 +1,97 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2025 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_PROTOCOL_PERMISSION_H_INCLUDED
#define RIPPLE_PROTOCOL_PERMISSION_H_INCLUDED
#include <xrpl/protocol/TxFormats.h>
#include <optional>
#include <string>
#include <unordered_map>
#include <unordered_set>
namespace ripple {
/**
* We have both transaction type permissions and granular type permissions.
* Since we will reuse the TransactionFormats to parse the Transaction
* Permissions, only the GranularPermissionType is defined here. To prevent
* conflicts with TxType, the GranularPermissionType is always set to a value
* greater than the maximum value of uint16.
*/
enum GranularPermissionType : std::uint32_t {
#pragma push_macro("PERMISSION")
#undef PERMISSION
#define PERMISSION(type, txType, value) type = value,
#include <xrpl/protocol/detail/permissions.macro>
#undef PERMISSION
#pragma pop_macro("PERMISSION")
};
enum Delegation { delegatable, notDelegatable };
class Permission
{
private:
Permission();
std::unordered_map<std::uint16_t, Delegation> delegatableTx_;
std::unordered_map<std::string, GranularPermissionType>
granularPermissionMap_;
std::unordered_map<GranularPermissionType, std::string> granularNameMap_;
std::unordered_map<GranularPermissionType, TxType> granularTxTypeMap_;
public:
static Permission const&
getInstance();
Permission(Permission const&) = delete;
Permission&
operator=(Permission const&) = delete;
std::optional<std::uint32_t>
getGranularValue(std::string const& name) const;
std::optional<std::string>
getGranularName(GranularPermissionType const& value) const;
std::optional<TxType>
getGranularTxType(GranularPermissionType const& gpType) const;
bool
isDelegatable(std::uint32_t const& permissionValue) const;
// for tx level permission, permission value is equal to tx type plus one
uint32_t
txToPermissionType(TxType const& type) const;
// tx type value is permission value minus one
TxType
permissionToTxType(uint32_t const& value) const;
};
} // namespace ripple
#endif

View File

@@ -122,6 +122,10 @@ std::size_t constexpr maxDataPayloadLength = 256;
/** Vault withdrawal policies */ /** Vault withdrawal policies */
std::uint8_t constexpr vaultStrategyFirstComeFirstServe = 1; std::uint8_t constexpr vaultStrategyFirstComeFirstServe = 1;
/** Maximum recursion depth for vault shares being put as an asset inside
* another vault; counted from 0 */
std::uint8_t constexpr maxAssetCheckDepth = 5;
/** A ledger index. */ /** A ledger index. */
using LedgerIndex = std::uint32_t; using LedgerIndex = std::uint32_t;
@@ -161,6 +165,10 @@ std::size_t constexpr maxPriceScale = 20;
*/ */
std::size_t constexpr maxTrim = 25; std::size_t constexpr maxTrim = 25;
/** The maximum number of delegate permissions an account can grant
*/
std::size_t constexpr permissionMaxSize = 10;
} // namespace ripple } // namespace ripple
#endif #endif

View File

@@ -113,8 +113,8 @@ public:
// have lower unsigned integer representations. // have lower unsigned integer representations.
using value_type = std::uint64_t; using value_type = std::uint64_t;
static const int minTickSize = 3; static int const minTickSize = 3;
static const int maxTickSize = 16; static int const maxTickSize = 16;
private: private:
// This has the same representation as STAmount, see the comment on the // This has the same representation as STAmount, see the comment on the

View File

@@ -181,22 +181,22 @@ public:
private_access_tag_t, private_access_tag_t,
SerializedTypeID tid, SerializedTypeID tid,
int fv, int fv,
const char* fn, char const* fn,
int meta = sMD_Default, int meta = sMD_Default,
IsSigning signing = IsSigning::yes); IsSigning signing = IsSigning::yes);
explicit SField(private_access_tag_t, int fc); explicit SField(private_access_tag_t, int fc);
static const SField& static SField const&
getField(int fieldCode); getField(int fieldCode);
static const SField& static SField const&
getField(std::string const& fieldName); getField(std::string const& fieldName);
static const SField& static SField const&
getField(int type, int value) getField(int type, int value)
{ {
return getField(field_code(type, value)); return getField(field_code(type, value));
} }
static const SField& static SField const&
getField(SerializedTypeID type, int value) getField(SerializedTypeID type, int value)
{ {
return getField(field_code(type, value)); return getField(field_code(type, value));
@@ -283,19 +283,19 @@ public:
} }
bool bool
operator==(const SField& f) const operator==(SField const& f) const
{ {
return fieldCode == f.fieldCode; return fieldCode == f.fieldCode;
} }
bool bool
operator!=(const SField& f) const operator!=(SField const& f) const
{ {
return fieldCode != f.fieldCode; return fieldCode != f.fieldCode;
} }
static int static int
compare(const SField& f1, const SField& f2); compare(SField const& f1, SField const& f2);
static std::map<int, SField const*> const& static std::map<int, SField const*> const&
getKnownCodeToField() getKnownCodeToField()

View File

@@ -58,7 +58,7 @@ public:
add(Serializer& s) const override; add(Serializer& s) const override;
bool bool
isEquivalent(const STBase& t) const override; isEquivalent(STBase const& t) const override;
bool bool
isDefault() const override; isDefault() const override;

View File

@@ -62,20 +62,20 @@ private:
public: public:
using value_type = STAmount; using value_type = STAmount;
static const int cMinOffset = -96; static int const cMinOffset = -96;
static const int cMaxOffset = 80; static int const cMaxOffset = 80;
// Maximum native value supported by the code // Maximum native value supported by the code
static const std::uint64_t cMinValue = 1000000000000000ull; static std::uint64_t const cMinValue = 1000000000000000ull;
static const std::uint64_t cMaxValue = 9999999999999999ull; static std::uint64_t const cMaxValue = 9999999999999999ull;
static const std::uint64_t cMaxNative = 9000000000000000000ull; static std::uint64_t const cMaxNative = 9000000000000000000ull;
// Max native value on network. // Max native value on network.
static const std::uint64_t cMaxNativeN = 100000000000000000ull; static std::uint64_t const cMaxNativeN = 100000000000000000ull;
static const std::uint64_t cIssuedCurrency = 0x8000000000000000ull; static std::uint64_t const cIssuedCurrency = 0x8000000000000000ull;
static const std::uint64_t cPositive = 0x4000000000000000ull; static std::uint64_t const cPositive = 0x4000000000000000ull;
static const std::uint64_t cMPToken = 0x2000000000000000ull; static std::uint64_t const cMPToken = 0x2000000000000000ull;
static const std::uint64_t cValueMask = ~(cPositive | cMPToken); static std::uint64_t const cValueMask = ~(cPositive | cMPToken);
static std::uint64_t const uRateOne; static std::uint64_t const uRateOne;
@@ -283,7 +283,7 @@ public:
add(Serializer& s) const override; add(Serializer& s) const override;
bool bool
isEquivalent(const STBase& t) const override; isEquivalent(STBase const& t) const override;
bool bool
isDefault() const override; isDefault() const override;

View File

@@ -128,13 +128,13 @@ public:
add(Serializer& s) const override; add(Serializer& s) const override;
void void
sort(bool (*compare)(const STObject& o1, const STObject& o2)); sort(bool (*compare)(STObject const& o1, STObject const& o2));
bool bool
operator==(const STArray& s) const; operator==(STArray const& s) const;
bool bool
operator!=(const STArray& s) const; operator!=(STArray const& s) const;
iterator iterator
erase(iterator pos); erase(iterator pos);
@@ -152,7 +152,7 @@ public:
getSType() const override; getSType() const override;
bool bool
isEquivalent(const STBase& t) const override; isEquivalent(STBase const& t) const override;
bool bool
isDefault() const override; isDefault() const override;
@@ -275,13 +275,13 @@ STArray::swap(STArray& a) noexcept
} }
inline bool inline bool
STArray::operator==(const STArray& s) const STArray::operator==(STArray const& s) const
{ {
return v_ == s.v_; return v_ == s.v_;
} }
inline bool inline bool
STArray::operator!=(const STArray& s) const STArray::operator!=(STArray const& s) const
{ {
return v_ != s.v_; return v_ != s.v_;
} }

View File

@@ -93,7 +93,9 @@ struct JsonOptions
}; };
template <typename T> template <typename T>
requires requires(T const& t) { t.getJson(JsonOptions::none); } requires requires(T const& t) {
{ t.getJson(JsonOptions::none) } -> std::convertible_to<Json::Value>;
}
Json::Value Json::Value
to_json(T const& t) to_json(T const& t)
{ {
@@ -137,16 +139,16 @@ class STBase
public: public:
virtual ~STBase() = default; virtual ~STBase() = default;
STBase(); STBase();
STBase(const STBase&) = default; STBase(STBase const&) = default;
STBase& STBase&
operator=(const STBase& t); operator=(STBase const& t);
explicit STBase(SField const& n); explicit STBase(SField const& n);
bool bool
operator==(const STBase& t) const; operator==(STBase const& t) const;
bool bool
operator!=(const STBase& t) const; operator!=(STBase const& t) const;
template <class D> template <class D>
D& D&
@@ -205,7 +207,7 @@ private:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
std::ostream& std::ostream&
operator<<(std::ostream& out, const STBase& t); operator<<(std::ostream& out, STBase const& t);
template <class D> template <class D>
D& D&

View File

@@ -45,8 +45,8 @@ public:
STBitString() = default; STBitString() = default;
STBitString(SField const& n); STBitString(SField const& n);
STBitString(const value_type& v); STBitString(value_type const& v);
STBitString(SField const& n, const value_type& v); STBitString(SField const& n, value_type const& v);
STBitString(SerialIter& sit, SField const& name); STBitString(SerialIter& sit, SField const& name);
SerializedTypeID SerializedTypeID
@@ -56,7 +56,7 @@ public:
getText() const override; getText() const override;
bool bool
isEquivalent(const STBase& t) const override; isEquivalent(STBase const& t) const override;
void void
add(Serializer& s) const override; add(Serializer& s) const override;
@@ -93,12 +93,12 @@ inline STBitString<Bits>::STBitString(SField const& n) : STBase(n)
} }
template <int Bits> template <int Bits>
inline STBitString<Bits>::STBitString(const value_type& v) : value_(v) inline STBitString<Bits>::STBitString(value_type const& v) : value_(v)
{ {
} }
template <int Bits> template <int Bits>
inline STBitString<Bits>::STBitString(SField const& n, const value_type& v) inline STBitString<Bits>::STBitString(SField const& n, value_type const& v)
: STBase(n), value_(v) : STBase(n), value_(v)
{ {
} }
@@ -160,9 +160,9 @@ STBitString<Bits>::getText() const
template <int Bits> template <int Bits>
bool bool
STBitString<Bits>::isEquivalent(const STBase& t) const STBitString<Bits>::isEquivalent(STBase const& t) const
{ {
const STBitString* v = dynamic_cast<const STBitString*>(&t); STBitString const* v = dynamic_cast<STBitString const*>(&t);
return v && (value_ == v->value_); return v && (value_ == v->value_);
} }

View File

@@ -63,7 +63,7 @@ public:
add(Serializer& s) const override; add(Serializer& s) const override;
bool bool
isEquivalent(const STBase& t) const override; isEquivalent(STBase const& t) const override;
bool bool
isDefault() const override; isDefault() const override;

View File

@@ -65,7 +65,7 @@ public:
add(Serializer& s) const override; add(Serializer& s) const override;
bool bool
isEquivalent(const STBase& t) const override; isEquivalent(STBase const& t) const override;
bool bool
isDefault() const override; isDefault() const override;

View File

@@ -54,7 +54,7 @@ public:
isDefault() const override; isDefault() const override;
bool bool
isEquivalent(const STBase& t) const override; isEquivalent(STBase const& t) const override;
STInteger& STInteger&
operator=(value_type const& v); operator=(value_type const& v);
@@ -127,9 +127,9 @@ STInteger<Integer>::isDefault() const
template <typename Integer> template <typename Integer>
inline bool inline bool
STInteger<Integer>::isEquivalent(const STBase& t) const STInteger<Integer>::isEquivalent(STBase const& t) const
{ {
const STInteger* v = dynamic_cast<const STInteger*>(&t); STInteger const* v = dynamic_cast<STInteger const*>(&t);
return v && (value_ == v->value_); return v && (value_ == v->value_);
} }

View File

@@ -48,12 +48,6 @@ public:
STIssue& STIssue&
operator=(STIssue const& rhs) = default; operator=(STIssue const& rhs) = default;
STIssue&
operator=(Asset const& rhs)
{
asset_ = rhs;
return *this;
}
template <ValidIssueType TIss> template <ValidIssueType TIss>
TIss const& TIss const&
@@ -81,7 +75,7 @@ public:
add(Serializer& s) const override; add(Serializer& s) const override;
bool bool
isEquivalent(const STBase& t) const override; isEquivalent(STBase const& t) const override;
bool bool
isDefault() const override; isDefault() const override;

View File

@@ -35,7 +35,7 @@ class STLedgerEntry final : public STObject, public CountedObject<STLedgerEntry>
public: public:
using pointer = std::shared_ptr<STLedgerEntry>; using pointer = std::shared_ptr<STLedgerEntry>;
using ref = const std::shared_ptr<STLedgerEntry>&; using ref = std::shared_ptr<STLedgerEntry> const&;
/** Create an empty object with the given key and type. */ /** Create an empty object with the given key and type. */
explicit STLedgerEntry(Keylet const& k); explicit STLedgerEntry(Keylet const& k);

View File

@@ -99,8 +99,8 @@ public:
STObject& STObject&
operator=(STObject&& other); operator=(STObject&& other);
STObject(const SOTemplate& type, SField const& name); STObject(SOTemplate const& type, SField const& name);
STObject(const SOTemplate& type, SerialIter& sit, SField const& name); STObject(SOTemplate const& type, SerialIter& sit, SField const& name);
STObject(SerialIter& sit, SField const& name, int depth = 0); STObject(SerialIter& sit, SField const& name, int depth = 0);
STObject(SerialIter&& sit, SField const& name); STObject(SerialIter&& sit, SField const& name);
explicit STObject(SField const& name); explicit STObject(SField const& name);
@@ -121,7 +121,7 @@ public:
reserve(std::size_t n); reserve(std::size_t n);
void void
applyTemplate(const SOTemplate& type); applyTemplate(SOTemplate const& type);
void void
applyTemplateFromSField(SField const&); applyTemplateFromSField(SField const&);
@@ -130,7 +130,7 @@ public:
isFree() const; isFree() const;
void void
set(const SOTemplate&); set(SOTemplate const&);
bool bool
set(SerialIter& u, int depth = 0); set(SerialIter& u, int depth = 0);
@@ -139,7 +139,7 @@ public:
getSType() const override; getSType() const override;
bool bool
isEquivalent(const STBase& t) const override; isEquivalent(STBase const& t) const override;
bool bool
isDefault() const override; isDefault() const override;
@@ -182,13 +182,13 @@ public:
uint256 uint256
getSigningHash(HashPrefix prefix) const; getSigningHash(HashPrefix prefix) const;
const STBase& STBase const&
peekAtIndex(int offset) const; peekAtIndex(int offset) const;
STBase& STBase&
getIndex(int offset); getIndex(int offset);
const STBase* STBase const*
peekAtPIndex(int offset) const; peekAtPIndex(int offset) const;
STBase* STBase*
@@ -200,13 +200,13 @@ public:
SField const& SField const&
getFieldSType(int index) const; getFieldSType(int index) const;
const STBase& STBase const&
peekAtField(SField const& field) const; peekAtField(SField const& field) const;
STBase& STBase&
getField(SField const& field); getField(SField const& field);
const STBase* STBase const*
peekAtPField(SField const& field) const; peekAtPField(SField const& field) const;
STBase* STBase*
@@ -240,11 +240,11 @@ public:
getFieldAmount(SField const& field) const; getFieldAmount(SField const& field) const;
STPathSet const& STPathSet const&
getFieldPathSet(SField const& field) const; getFieldPathSet(SField const& field) const;
const STVector256& STVector256 const&
getFieldV256(SField const& field) const; getFieldV256(SField const& field) const;
const STArray& STArray const&
getFieldArray(SField const& field) const; getFieldArray(SField const& field) const;
const STCurrency& STCurrency const&
getFieldCurrency(SField const& field) const; getFieldCurrency(SField const& field) const;
STNumber const& STNumber const&
getFieldNumber(SField const& field) const; getFieldNumber(SField const& field) const;
@@ -408,12 +408,12 @@ public:
delField(int index); delField(int index);
bool bool
hasMatchingEntry(const STBase&); hasMatchingEntry(STBase const&);
bool bool
operator==(const STObject& o) const; operator==(STObject const& o) const;
bool bool
operator!=(const STObject& o) const; operator!=(STObject const& o) const;
class FieldErr; class FieldErr;
@@ -981,7 +981,7 @@ STObject::getCount() const
return v_.size(); return v_.size();
} }
inline const STBase& inline STBase const&
STObject::peekAtIndex(int offset) const STObject::peekAtIndex(int offset) const
{ {
return v_[offset].get(); return v_[offset].get();
@@ -993,7 +993,7 @@ STObject::getIndex(int offset)
return v_[offset].get(); return v_[offset].get();
} }
inline const STBase* inline STBase const*
STObject::peekAtPIndex(int offset) const STObject::peekAtPIndex(int offset) const
{ {
return &v_[offset].get(); return &v_[offset].get();
@@ -1128,7 +1128,7 @@ STObject::setFieldH160(SField const& field, base_uint<160, Tag> const& v)
} }
inline bool inline bool
STObject::operator!=(const STObject& o) const STObject::operator!=(STObject const& o) const
{ {
return !(*this == o); return !(*this == o);
} }
@@ -1137,7 +1137,7 @@ template <typename T, typename V>
V V
STObject::getFieldByValue(SField const& field) const STObject::getFieldByValue(SField const& field) const
{ {
const STBase* rf = peekAtPField(field); STBase const* rf = peekAtPField(field);
if (!rf) if (!rf)
throwFieldNotFound(field); throwFieldNotFound(field);
@@ -1147,7 +1147,7 @@ STObject::getFieldByValue(SField const& field) const
if (id == STI_NOTPRESENT) if (id == STI_NOTPRESENT)
return V(); // optional field not present return V(); // optional field not present
const T* cf = dynamic_cast<const T*>(rf); T const* cf = dynamic_cast<T const*>(rf);
if (!cf) if (!cf)
Throw<std::runtime_error>("Wrong field type"); Throw<std::runtime_error>("Wrong field type");
@@ -1164,7 +1164,7 @@ template <typename T, typename V>
V const& V const&
STObject::getFieldByConstRef(SField const& field, V const& empty) const STObject::getFieldByConstRef(SField const& field, V const& empty) const
{ {
const STBase* rf = peekAtPField(field); STBase const* rf = peekAtPField(field);
if (!rf) if (!rf)
throwFieldNotFound(field); throwFieldNotFound(field);
@@ -1174,7 +1174,7 @@ STObject::getFieldByConstRef(SField const& field, V const& empty) const
if (id == STI_NOTPRESENT) if (id == STI_NOTPRESENT)
return empty; // optional field not present return empty; // optional field not present
const T* cf = dynamic_cast<const T*>(rf); T const* cf = dynamic_cast<T const*>(rf);
if (!cf) if (!cf)
Throw<std::runtime_error>("Wrong field type"); Throw<std::runtime_error>("Wrong field type");

View File

@@ -106,10 +106,10 @@ public:
getIssuerID() const; getIssuerID() const;
bool bool
operator==(const STPathElement& t) const; operator==(STPathElement const& t) const;
bool bool
operator!=(const STPathElement& t) const; operator!=(STPathElement const& t) const;
private: private:
static std::size_t static std::size_t
@@ -164,7 +164,7 @@ public:
STPathElement& STPathElement&
operator[](int i); operator[](int i);
const STPathElement& STPathElement const&
operator[](int i) const; operator[](int i) const;
void void
@@ -196,7 +196,7 @@ public:
assembleAdd(STPath const& base, STPathElement const& tail); assembleAdd(STPath const& base, STPathElement const& tail);
bool bool
isEquivalent(const STBase& t) const override; isEquivalent(STBase const& t) const override;
bool bool
isDefault() const override; isDefault() const override;
@@ -375,7 +375,7 @@ STPathElement::getIssuerID() const
} }
inline bool inline bool
STPathElement::operator==(const STPathElement& t) const STPathElement::operator==(STPathElement const& t) const
{ {
return (mType & typeAccount) == (t.mType & typeAccount) && return (mType & typeAccount) == (t.mType & typeAccount) &&
hash_value_ == t.hash_value_ && mAccountID == t.mAccountID && hash_value_ == t.hash_value_ && mAccountID == t.mAccountID &&
@@ -383,7 +383,7 @@ STPathElement::operator==(const STPathElement& t) const
} }
inline bool inline bool
STPathElement::operator!=(const STPathElement& t) const STPathElement::operator!=(STPathElement const& t) const
{ {
return !operator==(t); return !operator==(t);
} }
@@ -455,7 +455,7 @@ STPath::operator[](int i)
return mPath[i]; return mPath[i];
} }
inline const STPathElement& inline STPathElement const&
STPath::operator[](int i) const STPath::operator[](int i) const
{ {
return mPath[i]; return mPath[i];

View File

@@ -50,7 +50,7 @@ public:
Json::Value getJson(JsonOptions) const override; Json::Value getJson(JsonOptions) const override;
bool bool
isEquivalent(const STBase& t) const override; isEquivalent(STBase const& t) const override;
bool bool
isDefault() const override; isDefault() const override;
@@ -62,7 +62,7 @@ public:
operator=(std::vector<uint256>&& v); operator=(std::vector<uint256>&& v);
void void
setValue(const STVector256& v); setValue(STVector256 const& v);
/** Retrieve a copy of the vector we contain */ /** Retrieve a copy of the vector we contain */
explicit explicit
@@ -153,7 +153,7 @@ STVector256::operator=(std::vector<uint256>&& v)
} }
inline void inline void
STVector256::setValue(const STVector256& v) STVector256::setValue(STVector256 const& v)
{ {
mValue = v.mValue; mValue = v.mValue;
} }

View File

@@ -107,7 +107,7 @@ public:
add(Serializer& s) const override; add(Serializer& s) const override;
bool bool
isEquivalent(const STBase& t) const override; isEquivalent(STBase const& t) const override;
bool bool
isDefault() const override; isDefault() const override;

View File

@@ -139,9 +139,9 @@ public:
int int
addRaw(Slice slice); addRaw(Slice slice);
int int
addRaw(const void* ptr, int len); addRaw(void const* ptr, int len);
int int
addRaw(const Serializer& s); addRaw(Serializer const& s);
int int
addVL(Blob const& vector); addVL(Blob const& vector);
@@ -151,7 +151,7 @@ public:
int int
addVL(Iter begin, Iter end, int len); addVL(Iter begin, Iter end, int len);
int int
addVL(const void* ptr, int len); addVL(void const* ptr, int len);
// disassemble functions // disassemble functions
bool bool
@@ -161,7 +161,7 @@ public:
bool bool
getInteger(Integer& number, int offset) getInteger(Integer& number, int offset)
{ {
static const auto bytes = sizeof(Integer); static auto const bytes = sizeof(Integer);
if ((offset + bytes) > mData.size()) if ((offset + bytes) > mData.size())
return false; return false;
number = 0; number = 0;
@@ -220,7 +220,7 @@ public:
{ {
return mData.size(); return mData.size();
} }
const void* void const*
getDataPtr() const getDataPtr() const
{ {
return mData.data(); return mData.data();
@@ -238,7 +238,7 @@ public:
std::string std::string
getString() const getString() const
{ {
return std::string(static_cast<const char*>(getDataPtr()), size()); return std::string(static_cast<char const*>(getDataPtr()), size());
} }
void void
erase() erase()
@@ -296,12 +296,12 @@ public:
return v != mData; return v != mData;
} }
bool bool
operator==(const Serializer& v) const operator==(Serializer const& v) const
{ {
return v.mData == mData; return v.mData == mData;
} }
bool bool
operator!=(const Serializer& v) const operator!=(Serializer const& v) const
{ {
return v.mData != mData; return v.mData != mData;
} }

View File

@@ -120,6 +120,13 @@ constexpr std::uint32_t tfTrustSetMask =
~(tfUniversal | tfSetfAuth | tfSetNoRipple | tfClearNoRipple | tfSetFreeze | ~(tfUniversal | tfSetfAuth | tfSetNoRipple | tfClearNoRipple | tfSetFreeze |
tfClearFreeze | tfSetDeepFreeze | tfClearDeepFreeze); tfClearFreeze | tfSetDeepFreeze | tfClearDeepFreeze);
// valid flags for granular permission
constexpr std::uint32_t tfTrustSetGranularMask = tfSetfAuth | tfSetFreeze | tfClearFreeze;
// bits representing supportedGranularMask are set to 0 and the bits
// representing other flags are set to 1 in tfPermissionMask.
constexpr std::uint32_t tfTrustSetPermissionMask = (~tfTrustSetMask) & (~tfTrustSetGranularMask);
// EnableAmendment flags: // EnableAmendment flags:
constexpr std::uint32_t tfGotMajority = 0x00010000; constexpr std::uint32_t tfGotMajority = 0x00010000;
constexpr std::uint32_t tfLostMajority = 0x00020000; constexpr std::uint32_t tfLostMajority = 0x00020000;
@@ -155,6 +162,8 @@ constexpr std::uint32_t const tfMPTokenAuthorizeMask = ~(tfUniversal | tfMPTUna
constexpr std::uint32_t const tfMPTLock = 0x00000001; constexpr std::uint32_t const tfMPTLock = 0x00000001;
constexpr std::uint32_t const tfMPTUnlock = 0x00000002; constexpr std::uint32_t const tfMPTUnlock = 0x00000002;
constexpr std::uint32_t const tfMPTokenIssuanceSetMask = ~(tfUniversal | tfMPTLock | tfMPTUnlock); constexpr std::uint32_t const tfMPTokenIssuanceSetMask = ~(tfUniversal | tfMPTLock | tfMPTUnlock);
constexpr std::uint32_t const tfMPTokenIssuanceSetGranularMask = tfMPTLock | tfMPTUnlock;
constexpr std::uint32_t const tfMPTokenIssuanceSetPermissionMask = (~tfMPTokenIssuanceSetMask) & (~tfMPTokenIssuanceSetGranularMask);
// MPTokenIssuanceDestroy flags: // MPTokenIssuanceDestroy flags:
constexpr std::uint32_t const tfMPTokenIssuanceDestroyMask = ~tfUniversal; constexpr std::uint32_t const tfMPTokenIssuanceDestroyMask = ~tfUniversal;
@@ -230,9 +239,6 @@ constexpr std::uint32_t const tfVaultPrivate = 0x00010000;
static_assert(tfVaultPrivate == lsfVaultPrivate); static_assert(tfVaultPrivate == lsfVaultPrivate);
constexpr std::uint32_t const tfVaultShareNonTransferable = 0x00020000; constexpr std::uint32_t const tfVaultShareNonTransferable = 0x00020000;
constexpr std::uint32_t const tfVaultCreateMask = ~(tfUniversal | tfVaultPrivate | tfVaultShareNonTransferable); constexpr std::uint32_t const tfVaultCreateMask = ~(tfUniversal | tfVaultPrivate | tfVaultShareNonTransferable);
// VaultClawback flags:
constexpr std::uint32_t const tfVaultClawbackUnauth = 0x00010000;
constexpr std::uint32_t const tfVaultClawbackMask = ~(tfUniversal | tfVaultClawbackUnauth);
// clang-format on // clang-format on
} // namespace ripple } // namespace ripple

View File

@@ -59,7 +59,7 @@ enum TxType : std::uint16_t
#pragma push_macro("TRANSACTION") #pragma push_macro("TRANSACTION")
#undef TRANSACTION #undef TRANSACTION
#define TRANSACTION(tag, value, name, fields) tag = value, #define TRANSACTION(tag, value, name, delegatable, fields) tag = value,
#include <xrpl/protocol/detail/transactions.macro> #include <xrpl/protocol/detail/transactions.macro>

View File

@@ -61,8 +61,7 @@ using NodeID = base_uint<160, detail::NodeIDTag>;
/** MPTID is a 192-bit value representing MPT Issuance ID, /** MPTID is a 192-bit value representing MPT Issuance ID,
* which is a concatenation of a 32-bit sequence (big endian) * which is a concatenation of a 32-bit sequence (big endian)
* and a 160-bit account */ * and a 160-bit account */
// TODO - edhennis - Add a tag using MPTID = base_uint<192>;
using MPTID = uint192;
/** XRP currency. */ /** XRP currency. */
Currency const& Currency const&

View File

@@ -267,7 +267,7 @@ XRPAmount::decimalXRP() const
// Output XRPAmount as just the drops value. // Output XRPAmount as just the drops value.
template <class Char, class Traits> template <class Char, class Traits>
std::basic_ostream<Char, Traits>& std::basic_ostream<Char, Traits>&
operator<<(std::basic_ostream<Char, Traits>& os, const XRPAmount& q) operator<<(std::basic_ostream<Char, Traits>& os, XRPAmount const& q)
{ {
return os << q.drops(); return os << q.drops();
} }

View File

@@ -33,6 +33,8 @@
// in include/xrpl/protocol/Feature.h. // in include/xrpl/protocol/Feature.h.
XRPL_FEATURE(SingleAssetVault, Supported::no, VoteBehavior::DefaultNo) XRPL_FEATURE(SingleAssetVault, Supported::no, VoteBehavior::DefaultNo)
XRPL_FEATURE(PermissionDelegation, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (PayChanCancelAfter, Supported::yes, VoteBehavior::DefaultNo)
// Check flags in Credential transactions // Check flags in Credential transactions
XRPL_FIX (InvalidTxFlags, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (InvalidTxFlags, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (FrozenLPTokenTransfer, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (FrozenLPTokenTransfer, Supported::yes, VoteBehavior::DefaultNo)

View File

@@ -462,11 +462,23 @@ LEDGER_ENTRY(ltPERMISSIONED_DOMAIN, 0x0082, PermissionedDomain, permissioned_dom
{sfPreviousTxnLgrSeq, soeREQUIRED}, {sfPreviousTxnLgrSeq, soeREQUIRED},
})) }))
/** A ledger object representing permissions an account has delegated to another account.
\sa keylet::delegate
*/
LEDGER_ENTRY(ltDELEGATE, 0x0083, Delegate, delegate, ({
{sfAccount, soeREQUIRED},
{sfAuthorize, soeREQUIRED},
{sfPermissions, soeREQUIRED},
{sfOwnerNode, soeREQUIRED},
{sfPreviousTxnID, soeREQUIRED},
{sfPreviousTxnLgrSeq, soeREQUIRED},
}))
/** A ledger object representing a single asset vault. /** A ledger object representing a single asset vault.
\sa keylet::mptoken \sa keylet::mptoken
*/ */
LEDGER_ENTRY(ltVAULT, 0x0083, Vault, vault, ({ LEDGER_ENTRY(ltVAULT, 0x0084, Vault, vault, ({
{sfPreviousTxnID, soeREQUIRED}, {sfPreviousTxnID, soeREQUIRED},
{sfPreviousTxnLgrSeq, soeREQUIRED}, {sfPreviousTxnLgrSeq, soeREQUIRED},
{sfSequence, soeREQUIRED}, {sfSequence, soeREQUIRED},

View File

@@ -0,0 +1,68 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2025 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#if !defined(PERMISSION)
#error "undefined macro: PERMISSION"
#endif
/**
* PERMISSION(name, type, txType, value)
*
* This macro defines a permission:
* name: the name of the permission.
* type: the GranularPermissionType enum.
* txType: the corresponding TxType for this permission.
* value: the uint32 numeric value for the enum type.
*/
/** This permission grants the delegated account the ability to authorize a trustline. */
PERMISSION(TrustlineAuthorize, ttTRUST_SET, 65537)
/** This permission grants the delegated account the ability to freeze a trustline. */
PERMISSION(TrustlineFreeze, ttTRUST_SET, 65538)
/** This permission grants the delegated account the ability to unfreeze a trustline. */
PERMISSION(TrustlineUnfreeze, ttTRUST_SET, 65539)
/** This permission grants the delegated account the ability to set Domain. */
PERMISSION(AccountDomainSet, ttACCOUNT_SET, 65540)
/** This permission grants the delegated account the ability to set EmailHashSet. */
PERMISSION(AccountEmailHashSet, ttACCOUNT_SET, 65541)
/** This permission grants the delegated account the ability to set MessageKey. */
PERMISSION(AccountMessageKeySet, ttACCOUNT_SET, 65542)
/** This permission grants the delegated account the ability to set TransferRate. */
PERMISSION(AccountTransferRateSet, ttACCOUNT_SET, 65543)
/** This permission grants the delegated account the ability to set TickSize. */
PERMISSION(AccountTickSizeSet, ttACCOUNT_SET, 65544)
/** This permission grants the delegated account the ability to mint payment, which means sending a payment for a currency where the sending account is the issuer. */
PERMISSION(PaymentMint, ttPAYMENT, 65545)
/** This permission grants the delegated account the ability to burn payment, which means sending a payment for a currency where the destination account is the issuer */
PERMISSION(PaymentBurn, ttPAYMENT, 65546)
/** This permission grants the delegated account the ability to lock MPToken. */
PERMISSION(MPTokenIssuanceLock, ttMPTOKEN_ISSUANCE_SET, 65547)
/** This permission grants the delegated account the ability to unlock MPToken. */
PERMISSION(MPTokenIssuanceUnlock, ttMPTOKEN_ISSUANCE_SET, 65548)

View File

@@ -113,6 +113,7 @@ TYPED_SFIELD(sfEmitGeneration, UINT32, 46)
TYPED_SFIELD(sfVoteWeight, UINT32, 48) TYPED_SFIELD(sfVoteWeight, UINT32, 48)
TYPED_SFIELD(sfFirstNFTokenSequence, UINT32, 50) TYPED_SFIELD(sfFirstNFTokenSequence, UINT32, 50)
TYPED_SFIELD(sfOracleDocumentID, UINT32, 51) TYPED_SFIELD(sfOracleDocumentID, UINT32, 51)
TYPED_SFIELD(sfPermissionValue, UINT32, 52)
// 64-bit integers (common) // 64-bit integers (common)
TYPED_SFIELD(sfIndexNext, UINT64, 1) TYPED_SFIELD(sfIndexNext, UINT64, 1)
@@ -197,9 +198,9 @@ TYPED_SFIELD(sfVaultID, UINT256, 35)
// number (common) // number (common)
TYPED_SFIELD(sfNumber, NUMBER, 1) TYPED_SFIELD(sfNumber, NUMBER, 1)
TYPED_SFIELD(sfAssetsAvailable, NUMBER, 2) TYPED_SFIELD(sfAssetsAvailable, NUMBER, 2)
TYPED_SFIELD(sfAssetsMaximum, NUMBER, 3) TYPED_SFIELD(sfAssetsMaximum, NUMBER, 3)
TYPED_SFIELD(sfAssetsTotal, NUMBER, 4) TYPED_SFIELD(sfAssetsTotal, NUMBER, 4)
TYPED_SFIELD(sfLossUnrealized, NUMBER, 5) TYPED_SFIELD(sfLossUnrealized, NUMBER, 5)
// currency amount (common) // currency amount (common)
@@ -285,6 +286,7 @@ TYPED_SFIELD(sfRegularKey, ACCOUNT, 8)
TYPED_SFIELD(sfNFTokenMinter, ACCOUNT, 9) TYPED_SFIELD(sfNFTokenMinter, ACCOUNT, 9)
TYPED_SFIELD(sfEmitCallback, ACCOUNT, 10) TYPED_SFIELD(sfEmitCallback, ACCOUNT, 10)
TYPED_SFIELD(sfHolder, ACCOUNT, 11) TYPED_SFIELD(sfHolder, ACCOUNT, 11)
TYPED_SFIELD(sfDelegate, ACCOUNT, 12)
// account (uncommon) // account (uncommon)
TYPED_SFIELD(sfHookAccount, ACCOUNT, 16) TYPED_SFIELD(sfHookAccount, ACCOUNT, 16)
@@ -334,6 +336,7 @@ UNTYPED_SFIELD(sfSignerEntry, OBJECT, 11)
UNTYPED_SFIELD(sfNFToken, OBJECT, 12) UNTYPED_SFIELD(sfNFToken, OBJECT, 12)
UNTYPED_SFIELD(sfEmitDetails, OBJECT, 13) UNTYPED_SFIELD(sfEmitDetails, OBJECT, 13)
UNTYPED_SFIELD(sfHook, OBJECT, 14) UNTYPED_SFIELD(sfHook, OBJECT, 14)
UNTYPED_SFIELD(sfPermission, OBJECT, 15)
// inner object (uncommon) // inner object (uncommon)
UNTYPED_SFIELD(sfSigner, OBJECT, 16) UNTYPED_SFIELD(sfSigner, OBJECT, 16)
@@ -384,3 +387,4 @@ UNTYPED_SFIELD(sfAuthAccounts, ARRAY, 25)
UNTYPED_SFIELD(sfAuthorizeCredentials, ARRAY, 26) UNTYPED_SFIELD(sfAuthorizeCredentials, ARRAY, 26)
UNTYPED_SFIELD(sfUnauthorizeCredentials, ARRAY, 27) UNTYPED_SFIELD(sfUnauthorizeCredentials, ARRAY, 27)
UNTYPED_SFIELD(sfAcceptedCredentials, ARRAY, 28) UNTYPED_SFIELD(sfAcceptedCredentials, ARRAY, 28)
UNTYPED_SFIELD(sfPermissions, ARRAY, 29)

View File

@@ -50,7 +50,7 @@ class TokenCodecErrcCategory : public std::error_category
{ {
public: public:
// Return a short descriptive name for the category // Return a short descriptive name for the category
virtual const char* virtual char const*
name() const noexcept override final name() const noexcept override final
{ {
return "TokenCodecError"; return "TokenCodecError";
@@ -86,7 +86,7 @@ public:
}; };
} // namespace detail } // namespace detail
inline const ripple::detail::TokenCodecErrcCategory& inline ripple::detail::TokenCodecErrcCategory const&
TokenCodecErrcCategory() TokenCodecErrcCategory()
{ {
static ripple::detail::TokenCodecErrcCategory c; static ripple::detail::TokenCodecErrcCategory c;

View File

@@ -22,14 +22,14 @@
#endif #endif
/** /**
* TRANSACTION(tag, value, name, fields) * TRANSACTION(tag, value, name, delegatable, fields)
* *
* You must define a transactor class in the `ripple` namespace named `name`, * You must define a transactor class in the `ripple` namespace named `name`,
* and include its header in `src/xrpld/app/tx/detail/applySteps.cpp`. * and include its header in `src/xrpld/app/tx/detail/applySteps.cpp`.
*/ */
/** This transaction type executes a payment. */ /** This transaction type executes a payment. */
TRANSACTION(ttPAYMENT, 0, Payment, ({ TRANSACTION(ttPAYMENT, 0, Payment, Delegation::delegatable, ({
{sfDestination, soeREQUIRED}, {sfDestination, soeREQUIRED},
{sfAmount, soeREQUIRED, soeMPTSupported}, {sfAmount, soeREQUIRED, soeMPTSupported},
{sfSendMax, soeOPTIONAL, soeMPTSupported}, {sfSendMax, soeOPTIONAL, soeMPTSupported},
@@ -41,7 +41,7 @@ TRANSACTION(ttPAYMENT, 0, Payment, ({
})) }))
/** This transaction type creates an escrow object. */ /** This transaction type creates an escrow object. */
TRANSACTION(ttESCROW_CREATE, 1, EscrowCreate, ({ TRANSACTION(ttESCROW_CREATE, 1, EscrowCreate, Delegation::delegatable, ({
{sfDestination, soeREQUIRED}, {sfDestination, soeREQUIRED},
{sfAmount, soeREQUIRED}, {sfAmount, soeREQUIRED},
{sfCondition, soeOPTIONAL}, {sfCondition, soeOPTIONAL},
@@ -51,7 +51,7 @@ TRANSACTION(ttESCROW_CREATE, 1, EscrowCreate, ({
})) }))
/** This transaction type completes an existing escrow. */ /** This transaction type completes an existing escrow. */
TRANSACTION(ttESCROW_FINISH, 2, EscrowFinish, ({ TRANSACTION(ttESCROW_FINISH, 2, EscrowFinish, Delegation::delegatable, ({
{sfOwner, soeREQUIRED}, {sfOwner, soeREQUIRED},
{sfOfferSequence, soeREQUIRED}, {sfOfferSequence, soeREQUIRED},
{sfFulfillment, soeOPTIONAL}, {sfFulfillment, soeOPTIONAL},
@@ -61,7 +61,7 @@ TRANSACTION(ttESCROW_FINISH, 2, EscrowFinish, ({
/** This transaction type adjusts various account settings. */ /** This transaction type adjusts various account settings. */
TRANSACTION(ttACCOUNT_SET, 3, AccountSet, ({ TRANSACTION(ttACCOUNT_SET, 3, AccountSet, Delegation::notDelegatable, ({
{sfEmailHash, soeOPTIONAL}, {sfEmailHash, soeOPTIONAL},
{sfWalletLocator, soeOPTIONAL}, {sfWalletLocator, soeOPTIONAL},
{sfWalletSize, soeOPTIONAL}, {sfWalletSize, soeOPTIONAL},
@@ -75,20 +75,20 @@ TRANSACTION(ttACCOUNT_SET, 3, AccountSet, ({
})) }))
/** This transaction type cancels an existing escrow. */ /** This transaction type cancels an existing escrow. */
TRANSACTION(ttESCROW_CANCEL, 4, EscrowCancel, ({ TRANSACTION(ttESCROW_CANCEL, 4, EscrowCancel, Delegation::delegatable, ({
{sfOwner, soeREQUIRED}, {sfOwner, soeREQUIRED},
{sfOfferSequence, soeREQUIRED}, {sfOfferSequence, soeREQUIRED},
})) }))
/** This transaction type sets or clears an account's "regular key". */ /** This transaction type sets or clears an account's "regular key". */
TRANSACTION(ttREGULAR_KEY_SET, 5, SetRegularKey, ({ TRANSACTION(ttREGULAR_KEY_SET, 5, SetRegularKey, Delegation::notDelegatable, ({
{sfRegularKey, soeOPTIONAL}, {sfRegularKey, soeOPTIONAL},
})) }))
// 6 deprecated // 6 deprecated
/** This transaction type creates an offer to trade one asset for another. */ /** This transaction type creates an offer to trade one asset for another. */
TRANSACTION(ttOFFER_CREATE, 7, OfferCreate, ({ TRANSACTION(ttOFFER_CREATE, 7, OfferCreate, Delegation::delegatable, ({
{sfTakerPays, soeREQUIRED}, {sfTakerPays, soeREQUIRED},
{sfTakerGets, soeREQUIRED}, {sfTakerGets, soeREQUIRED},
{sfExpiration, soeOPTIONAL}, {sfExpiration, soeOPTIONAL},
@@ -96,14 +96,14 @@ TRANSACTION(ttOFFER_CREATE, 7, OfferCreate, ({
})) }))
/** This transaction type cancels existing offers to trade one asset for another. */ /** This transaction type cancels existing offers to trade one asset for another. */
TRANSACTION(ttOFFER_CANCEL, 8, OfferCancel, ({ TRANSACTION(ttOFFER_CANCEL, 8, OfferCancel, Delegation::delegatable, ({
{sfOfferSequence, soeREQUIRED}, {sfOfferSequence, soeREQUIRED},
})) }))
// 9 deprecated // 9 deprecated
/** This transaction type creates a new set of tickets. */ /** This transaction type creates a new set of tickets. */
TRANSACTION(ttTICKET_CREATE, 10, TicketCreate, ({ TRANSACTION(ttTICKET_CREATE, 10, TicketCreate, Delegation::delegatable, ({
{sfTicketCount, soeREQUIRED}, {sfTicketCount, soeREQUIRED},
})) }))
@@ -112,13 +112,13 @@ TRANSACTION(ttTICKET_CREATE, 10, TicketCreate, ({
/** This transaction type modifies the signer list associated with an account. */ /** This transaction type modifies the signer list associated with an account. */
// The SignerEntries are optional because a SignerList is deleted by // The SignerEntries are optional because a SignerList is deleted by
// setting the SignerQuorum to zero and omitting SignerEntries. // setting the SignerQuorum to zero and omitting SignerEntries.
TRANSACTION(ttSIGNER_LIST_SET, 12, SignerListSet, ({ TRANSACTION(ttSIGNER_LIST_SET, 12, SignerListSet, Delegation::notDelegatable, ({
{sfSignerQuorum, soeREQUIRED}, {sfSignerQuorum, soeREQUIRED},
{sfSignerEntries, soeOPTIONAL}, {sfSignerEntries, soeOPTIONAL},
})) }))
/** This transaction type creates a new unidirectional XRP payment channel. */ /** This transaction type creates a new unidirectional XRP payment channel. */
TRANSACTION(ttPAYCHAN_CREATE, 13, PaymentChannelCreate, ({ TRANSACTION(ttPAYCHAN_CREATE, 13, PaymentChannelCreate, Delegation::delegatable, ({
{sfDestination, soeREQUIRED}, {sfDestination, soeREQUIRED},
{sfAmount, soeREQUIRED}, {sfAmount, soeREQUIRED},
{sfSettleDelay, soeREQUIRED}, {sfSettleDelay, soeREQUIRED},
@@ -128,14 +128,14 @@ TRANSACTION(ttPAYCHAN_CREATE, 13, PaymentChannelCreate, ({
})) }))
/** This transaction type funds an existing unidirectional XRP payment channel. */ /** This transaction type funds an existing unidirectional XRP payment channel. */
TRANSACTION(ttPAYCHAN_FUND, 14, PaymentChannelFund, ({ TRANSACTION(ttPAYCHAN_FUND, 14, PaymentChannelFund, Delegation::delegatable, ({
{sfChannel, soeREQUIRED}, {sfChannel, soeREQUIRED},
{sfAmount, soeREQUIRED}, {sfAmount, soeREQUIRED},
{sfExpiration, soeOPTIONAL}, {sfExpiration, soeOPTIONAL},
})) }))
/** This transaction type submits a claim against an existing unidirectional payment channel. */ /** This transaction type submits a claim against an existing unidirectional payment channel. */
TRANSACTION(ttPAYCHAN_CLAIM, 15, PaymentChannelClaim, ({ TRANSACTION(ttPAYCHAN_CLAIM, 15, PaymentChannelClaim, Delegation::delegatable, ({
{sfChannel, soeREQUIRED}, {sfChannel, soeREQUIRED},
{sfAmount, soeOPTIONAL}, {sfAmount, soeOPTIONAL},
{sfBalance, soeOPTIONAL}, {sfBalance, soeOPTIONAL},
@@ -145,7 +145,7 @@ TRANSACTION(ttPAYCHAN_CLAIM, 15, PaymentChannelClaim, ({
})) }))
/** This transaction type creates a new check. */ /** This transaction type creates a new check. */
TRANSACTION(ttCHECK_CREATE, 16, CheckCreate, ({ TRANSACTION(ttCHECK_CREATE, 16, CheckCreate, Delegation::delegatable, ({
{sfDestination, soeREQUIRED}, {sfDestination, soeREQUIRED},
{sfSendMax, soeREQUIRED}, {sfSendMax, soeREQUIRED},
{sfExpiration, soeOPTIONAL}, {sfExpiration, soeOPTIONAL},
@@ -154,19 +154,19 @@ TRANSACTION(ttCHECK_CREATE, 16, CheckCreate, ({
})) }))
/** This transaction type cashes an existing check. */ /** This transaction type cashes an existing check. */
TRANSACTION(ttCHECK_CASH, 17, CheckCash, ({ TRANSACTION(ttCHECK_CASH, 17, CheckCash, Delegation::delegatable, ({
{sfCheckID, soeREQUIRED}, {sfCheckID, soeREQUIRED},
{sfAmount, soeOPTIONAL}, {sfAmount, soeOPTIONAL},
{sfDeliverMin, soeOPTIONAL}, {sfDeliverMin, soeOPTIONAL},
})) }))
/** This transaction type cancels an existing check. */ /** This transaction type cancels an existing check. */
TRANSACTION(ttCHECK_CANCEL, 18, CheckCancel, ({ TRANSACTION(ttCHECK_CANCEL, 18, CheckCancel, Delegation::delegatable, ({
{sfCheckID, soeREQUIRED}, {sfCheckID, soeREQUIRED},
})) }))
/** This transaction type grants or revokes authorization to transfer funds. */ /** This transaction type grants or revokes authorization to transfer funds. */
TRANSACTION(ttDEPOSIT_PREAUTH, 19, DepositPreauth, ({ TRANSACTION(ttDEPOSIT_PREAUTH, 19, DepositPreauth, Delegation::delegatable, ({
{sfAuthorize, soeOPTIONAL}, {sfAuthorize, soeOPTIONAL},
{sfUnauthorize, soeOPTIONAL}, {sfUnauthorize, soeOPTIONAL},
{sfAuthorizeCredentials, soeOPTIONAL}, {sfAuthorizeCredentials, soeOPTIONAL},
@@ -174,14 +174,14 @@ TRANSACTION(ttDEPOSIT_PREAUTH, 19, DepositPreauth, ({
})) }))
/** This transaction type modifies a trustline between two accounts. */ /** This transaction type modifies a trustline between two accounts. */
TRANSACTION(ttTRUST_SET, 20, TrustSet, ({ TRANSACTION(ttTRUST_SET, 20, TrustSet, Delegation::delegatable, ({
{sfLimitAmount, soeOPTIONAL}, {sfLimitAmount, soeOPTIONAL},
{sfQualityIn, soeOPTIONAL}, {sfQualityIn, soeOPTIONAL},
{sfQualityOut, soeOPTIONAL}, {sfQualityOut, soeOPTIONAL},
})) }))
/** This transaction type deletes an existing account. */ /** This transaction type deletes an existing account. */
TRANSACTION(ttACCOUNT_DELETE, 21, AccountDelete, ({ TRANSACTION(ttACCOUNT_DELETE, 21, AccountDelete, Delegation::notDelegatable, ({
{sfDestination, soeREQUIRED}, {sfDestination, soeREQUIRED},
{sfDestinationTag, soeOPTIONAL}, {sfDestinationTag, soeOPTIONAL},
{sfCredentialIDs, soeOPTIONAL}, {sfCredentialIDs, soeOPTIONAL},
@@ -190,7 +190,7 @@ TRANSACTION(ttACCOUNT_DELETE, 21, AccountDelete, ({
// 22 reserved // 22 reserved
/** This transaction mints a new NFT. */ /** This transaction mints a new NFT. */
TRANSACTION(ttNFTOKEN_MINT, 25, NFTokenMint, ({ TRANSACTION(ttNFTOKEN_MINT, 25, NFTokenMint, Delegation::delegatable, ({
{sfNFTokenTaxon, soeREQUIRED}, {sfNFTokenTaxon, soeREQUIRED},
{sfTransferFee, soeOPTIONAL}, {sfTransferFee, soeOPTIONAL},
{sfIssuer, soeOPTIONAL}, {sfIssuer, soeOPTIONAL},
@@ -201,13 +201,13 @@ TRANSACTION(ttNFTOKEN_MINT, 25, NFTokenMint, ({
})) }))
/** This transaction burns (i.e. destroys) an existing NFT. */ /** This transaction burns (i.e. destroys) an existing NFT. */
TRANSACTION(ttNFTOKEN_BURN, 26, NFTokenBurn, ({ TRANSACTION(ttNFTOKEN_BURN, 26, NFTokenBurn, Delegation::delegatable, ({
{sfNFTokenID, soeREQUIRED}, {sfNFTokenID, soeREQUIRED},
{sfOwner, soeOPTIONAL}, {sfOwner, soeOPTIONAL},
})) }))
/** This transaction creates a new offer to buy or sell an NFT. */ /** This transaction creates a new offer to buy or sell an NFT. */
TRANSACTION(ttNFTOKEN_CREATE_OFFER, 27, NFTokenCreateOffer, ({ TRANSACTION(ttNFTOKEN_CREATE_OFFER, 27, NFTokenCreateOffer, Delegation::delegatable, ({
{sfNFTokenID, soeREQUIRED}, {sfNFTokenID, soeREQUIRED},
{sfAmount, soeREQUIRED}, {sfAmount, soeREQUIRED},
{sfDestination, soeOPTIONAL}, {sfDestination, soeOPTIONAL},
@@ -216,25 +216,25 @@ TRANSACTION(ttNFTOKEN_CREATE_OFFER, 27, NFTokenCreateOffer, ({
})) }))
/** This transaction cancels an existing offer to buy or sell an existing NFT. */ /** This transaction cancels an existing offer to buy or sell an existing NFT. */
TRANSACTION(ttNFTOKEN_CANCEL_OFFER, 28, NFTokenCancelOffer, ({ TRANSACTION(ttNFTOKEN_CANCEL_OFFER, 28, NFTokenCancelOffer, Delegation::delegatable, ({
{sfNFTokenOffers, soeREQUIRED}, {sfNFTokenOffers, soeREQUIRED},
})) }))
/** This transaction accepts an existing offer to buy or sell an existing NFT. */ /** This transaction accepts an existing offer to buy or sell an existing NFT. */
TRANSACTION(ttNFTOKEN_ACCEPT_OFFER, 29, NFTokenAcceptOffer, ({ TRANSACTION(ttNFTOKEN_ACCEPT_OFFER, 29, NFTokenAcceptOffer, Delegation::delegatable, ({
{sfNFTokenBuyOffer, soeOPTIONAL}, {sfNFTokenBuyOffer, soeOPTIONAL},
{sfNFTokenSellOffer, soeOPTIONAL}, {sfNFTokenSellOffer, soeOPTIONAL},
{sfNFTokenBrokerFee, soeOPTIONAL}, {sfNFTokenBrokerFee, soeOPTIONAL},
})) }))
/** This transaction claws back issued tokens. */ /** This transaction claws back issued tokens. */
TRANSACTION(ttCLAWBACK, 30, Clawback, ({ TRANSACTION(ttCLAWBACK, 30, Clawback, Delegation::delegatable, ({
{sfAmount, soeREQUIRED, soeMPTSupported}, {sfAmount, soeREQUIRED, soeMPTSupported},
{sfHolder, soeOPTIONAL}, {sfHolder, soeOPTIONAL},
})) }))
/** This transaction claws back tokens from an AMM pool. */ /** This transaction claws back tokens from an AMM pool. */
TRANSACTION(ttAMM_CLAWBACK, 31, AMMClawback, ({ TRANSACTION(ttAMM_CLAWBACK, 31, AMMClawback, Delegation::delegatable, ({
{sfHolder, soeREQUIRED}, {sfHolder, soeREQUIRED},
{sfAsset, soeREQUIRED}, {sfAsset, soeREQUIRED},
{sfAsset2, soeREQUIRED}, {sfAsset2, soeREQUIRED},
@@ -242,14 +242,14 @@ TRANSACTION(ttAMM_CLAWBACK, 31, AMMClawback, ({
})) }))
/** This transaction type creates an AMM instance */ /** This transaction type creates an AMM instance */
TRANSACTION(ttAMM_CREATE, 35, AMMCreate, ({ TRANSACTION(ttAMM_CREATE, 35, AMMCreate, Delegation::delegatable, ({
{sfAmount, soeREQUIRED}, {sfAmount, soeREQUIRED},
{sfAmount2, soeREQUIRED}, {sfAmount2, soeREQUIRED},
{sfTradingFee, soeREQUIRED}, {sfTradingFee, soeREQUIRED},
})) }))
/** This transaction type deposits into an AMM instance */ /** This transaction type deposits into an AMM instance */
TRANSACTION(ttAMM_DEPOSIT, 36, AMMDeposit, ({ TRANSACTION(ttAMM_DEPOSIT, 36, AMMDeposit, Delegation::delegatable, ({
{sfAsset, soeREQUIRED}, {sfAsset, soeREQUIRED},
{sfAsset2, soeREQUIRED}, {sfAsset2, soeREQUIRED},
{sfAmount, soeOPTIONAL}, {sfAmount, soeOPTIONAL},
@@ -260,7 +260,7 @@ TRANSACTION(ttAMM_DEPOSIT, 36, AMMDeposit, ({
})) }))
/** This transaction type withdraws from an AMM instance */ /** This transaction type withdraws from an AMM instance */
TRANSACTION(ttAMM_WITHDRAW, 37, AMMWithdraw, ({ TRANSACTION(ttAMM_WITHDRAW, 37, AMMWithdraw, Delegation::delegatable, ({
{sfAsset, soeREQUIRED}, {sfAsset, soeREQUIRED},
{sfAsset2, soeREQUIRED}, {sfAsset2, soeREQUIRED},
{sfAmount, soeOPTIONAL}, {sfAmount, soeOPTIONAL},
@@ -270,14 +270,14 @@ TRANSACTION(ttAMM_WITHDRAW, 37, AMMWithdraw, ({
})) }))
/** This transaction type votes for the trading fee */ /** This transaction type votes for the trading fee */
TRANSACTION(ttAMM_VOTE, 38, AMMVote, ({ TRANSACTION(ttAMM_VOTE, 38, AMMVote, Delegation::delegatable, ({
{sfAsset, soeREQUIRED}, {sfAsset, soeREQUIRED},
{sfAsset2, soeREQUIRED}, {sfAsset2, soeREQUIRED},
{sfTradingFee, soeREQUIRED}, {sfTradingFee, soeREQUIRED},
})) }))
/** This transaction type bids for the auction slot */ /** This transaction type bids for the auction slot */
TRANSACTION(ttAMM_BID, 39, AMMBid, ({ TRANSACTION(ttAMM_BID, 39, AMMBid, Delegation::delegatable, ({
{sfAsset, soeREQUIRED}, {sfAsset, soeREQUIRED},
{sfAsset2, soeREQUIRED}, {sfAsset2, soeREQUIRED},
{sfBidMin, soeOPTIONAL}, {sfBidMin, soeOPTIONAL},
@@ -286,20 +286,20 @@ TRANSACTION(ttAMM_BID, 39, AMMBid, ({
})) }))
/** This transaction type deletes AMM in the empty state */ /** This transaction type deletes AMM in the empty state */
TRANSACTION(ttAMM_DELETE, 40, AMMDelete, ({ TRANSACTION(ttAMM_DELETE, 40, AMMDelete, Delegation::delegatable, ({
{sfAsset, soeREQUIRED}, {sfAsset, soeREQUIRED},
{sfAsset2, soeREQUIRED}, {sfAsset2, soeREQUIRED},
})) }))
/** This transactions creates a crosschain sequence number */ /** This transactions creates a crosschain sequence number */
TRANSACTION(ttXCHAIN_CREATE_CLAIM_ID, 41, XChainCreateClaimID, ({ TRANSACTION(ttXCHAIN_CREATE_CLAIM_ID, 41, XChainCreateClaimID, Delegation::delegatable, ({
{sfXChainBridge, soeREQUIRED}, {sfXChainBridge, soeREQUIRED},
{sfSignatureReward, soeREQUIRED}, {sfSignatureReward, soeREQUIRED},
{sfOtherChainSource, soeREQUIRED}, {sfOtherChainSource, soeREQUIRED},
})) }))
/** This transactions initiates a crosschain transaction */ /** This transactions initiates a crosschain transaction */
TRANSACTION(ttXCHAIN_COMMIT, 42, XChainCommit, ({ TRANSACTION(ttXCHAIN_COMMIT, 42, XChainCommit, Delegation::delegatable, ({
{sfXChainBridge, soeREQUIRED}, {sfXChainBridge, soeREQUIRED},
{sfXChainClaimID, soeREQUIRED}, {sfXChainClaimID, soeREQUIRED},
{sfAmount, soeREQUIRED}, {sfAmount, soeREQUIRED},
@@ -307,7 +307,7 @@ TRANSACTION(ttXCHAIN_COMMIT, 42, XChainCommit, ({
})) }))
/** This transaction completes a crosschain transaction */ /** This transaction completes a crosschain transaction */
TRANSACTION(ttXCHAIN_CLAIM, 43, XChainClaim, ({ TRANSACTION(ttXCHAIN_CLAIM, 43, XChainClaim, Delegation::delegatable, ({
{sfXChainBridge, soeREQUIRED}, {sfXChainBridge, soeREQUIRED},
{sfXChainClaimID, soeREQUIRED}, {sfXChainClaimID, soeREQUIRED},
{sfDestination, soeREQUIRED}, {sfDestination, soeREQUIRED},
@@ -316,7 +316,7 @@ TRANSACTION(ttXCHAIN_CLAIM, 43, XChainClaim, ({
})) }))
/** This transaction initiates a crosschain account create transaction */ /** This transaction initiates a crosschain account create transaction */
TRANSACTION(ttXCHAIN_ACCOUNT_CREATE_COMMIT, 44, XChainAccountCreateCommit, ({ TRANSACTION(ttXCHAIN_ACCOUNT_CREATE_COMMIT, 44, XChainAccountCreateCommit, Delegation::delegatable, ({
{sfXChainBridge, soeREQUIRED}, {sfXChainBridge, soeREQUIRED},
{sfDestination, soeREQUIRED}, {sfDestination, soeREQUIRED},
{sfAmount, soeREQUIRED}, {sfAmount, soeREQUIRED},
@@ -324,7 +324,7 @@ TRANSACTION(ttXCHAIN_ACCOUNT_CREATE_COMMIT, 44, XChainAccountCreateCommit, ({
})) }))
/** This transaction adds an attestation to a claim */ /** This transaction adds an attestation to a claim */
TRANSACTION(ttXCHAIN_ADD_CLAIM_ATTESTATION, 45, XChainAddClaimAttestation, ({ TRANSACTION(ttXCHAIN_ADD_CLAIM_ATTESTATION, 45, XChainAddClaimAttestation, Delegation::delegatable, ({
{sfXChainBridge, soeREQUIRED}, {sfXChainBridge, soeREQUIRED},
{sfAttestationSignerAccount, soeREQUIRED}, {sfAttestationSignerAccount, soeREQUIRED},
@@ -340,7 +340,7 @@ TRANSACTION(ttXCHAIN_ADD_CLAIM_ATTESTATION, 45, XChainAddClaimAttestation, ({
})) }))
/** This transaction adds an attestation to an account */ /** This transaction adds an attestation to an account */
TRANSACTION(ttXCHAIN_ADD_ACCOUNT_CREATE_ATTESTATION, 46, XChainAddAccountCreateAttestation, ({ TRANSACTION(ttXCHAIN_ADD_ACCOUNT_CREATE_ATTESTATION, 46, XChainAddAccountCreateAttestation, Delegation::delegatable, ({
{sfXChainBridge, soeREQUIRED}, {sfXChainBridge, soeREQUIRED},
{sfAttestationSignerAccount, soeREQUIRED}, {sfAttestationSignerAccount, soeREQUIRED},
@@ -357,31 +357,31 @@ TRANSACTION(ttXCHAIN_ADD_ACCOUNT_CREATE_ATTESTATION, 46, XChainAddAccountCreateA
})) }))
/** This transaction modifies a sidechain */ /** This transaction modifies a sidechain */
TRANSACTION(ttXCHAIN_MODIFY_BRIDGE, 47, XChainModifyBridge, ({ TRANSACTION(ttXCHAIN_MODIFY_BRIDGE, 47, XChainModifyBridge, Delegation::delegatable, ({
{sfXChainBridge, soeREQUIRED}, {sfXChainBridge, soeREQUIRED},
{sfSignatureReward, soeOPTIONAL}, {sfSignatureReward, soeOPTIONAL},
{sfMinAccountCreateAmount, soeOPTIONAL}, {sfMinAccountCreateAmount, soeOPTIONAL},
})) }))
/** This transactions creates a sidechain */ /** This transactions creates a sidechain */
TRANSACTION(ttXCHAIN_CREATE_BRIDGE, 48, XChainCreateBridge, ({ TRANSACTION(ttXCHAIN_CREATE_BRIDGE, 48, XChainCreateBridge, Delegation::delegatable, ({
{sfXChainBridge, soeREQUIRED}, {sfXChainBridge, soeREQUIRED},
{sfSignatureReward, soeREQUIRED}, {sfSignatureReward, soeREQUIRED},
{sfMinAccountCreateAmount, soeOPTIONAL}, {sfMinAccountCreateAmount, soeOPTIONAL},
})) }))
/** This transaction type creates or updates a DID */ /** This transaction type creates or updates a DID */
TRANSACTION(ttDID_SET, 49, DIDSet, ({ TRANSACTION(ttDID_SET, 49, DIDSet, Delegation::delegatable, ({
{sfDIDDocument, soeOPTIONAL}, {sfDIDDocument, soeOPTIONAL},
{sfURI, soeOPTIONAL}, {sfURI, soeOPTIONAL},
{sfData, soeOPTIONAL}, {sfData, soeOPTIONAL},
})) }))
/** This transaction type deletes a DID */ /** This transaction type deletes a DID */
TRANSACTION(ttDID_DELETE, 50, DIDDelete, ({})) TRANSACTION(ttDID_DELETE, 50, DIDDelete, Delegation::delegatable, ({}))
/** This transaction type creates an Oracle instance */ /** This transaction type creates an Oracle instance */
TRANSACTION(ttORACLE_SET, 51, OracleSet, ({ TRANSACTION(ttORACLE_SET, 51, OracleSet, Delegation::delegatable, ({
{sfOracleDocumentID, soeREQUIRED}, {sfOracleDocumentID, soeREQUIRED},
{sfProvider, soeOPTIONAL}, {sfProvider, soeOPTIONAL},
{sfURI, soeOPTIONAL}, {sfURI, soeOPTIONAL},
@@ -391,18 +391,18 @@ TRANSACTION(ttORACLE_SET, 51, OracleSet, ({
})) }))
/** This transaction type deletes an Oracle instance */ /** This transaction type deletes an Oracle instance */
TRANSACTION(ttORACLE_DELETE, 52, OracleDelete, ({ TRANSACTION(ttORACLE_DELETE, 52, OracleDelete, Delegation::delegatable, ({
{sfOracleDocumentID, soeREQUIRED}, {sfOracleDocumentID, soeREQUIRED},
})) }))
/** This transaction type fixes a problem in the ledger state */ /** This transaction type fixes a problem in the ledger state */
TRANSACTION(ttLEDGER_STATE_FIX, 53, LedgerStateFix, ({ TRANSACTION(ttLEDGER_STATE_FIX, 53, LedgerStateFix, Delegation::delegatable, ({
{sfLedgerFixType, soeREQUIRED}, {sfLedgerFixType, soeREQUIRED},
{sfOwner, soeOPTIONAL}, {sfOwner, soeOPTIONAL},
})) }))
/** This transaction type creates a MPTokensIssuance instance */ /** This transaction type creates a MPTokensIssuance instance */
TRANSACTION(ttMPTOKEN_ISSUANCE_CREATE, 54, MPTokenIssuanceCreate, ({ TRANSACTION(ttMPTOKEN_ISSUANCE_CREATE, 54, MPTokenIssuanceCreate, Delegation::delegatable, ({
{sfAssetScale, soeOPTIONAL}, {sfAssetScale, soeOPTIONAL},
{sfTransferFee, soeOPTIONAL}, {sfTransferFee, soeOPTIONAL},
{sfMaximumAmount, soeOPTIONAL}, {sfMaximumAmount, soeOPTIONAL},
@@ -410,24 +410,24 @@ TRANSACTION(ttMPTOKEN_ISSUANCE_CREATE, 54, MPTokenIssuanceCreate, ({
})) }))
/** This transaction type destroys a MPTokensIssuance instance */ /** This transaction type destroys a MPTokensIssuance instance */
TRANSACTION(ttMPTOKEN_ISSUANCE_DESTROY, 55, MPTokenIssuanceDestroy, ({ TRANSACTION(ttMPTOKEN_ISSUANCE_DESTROY, 55, MPTokenIssuanceDestroy, Delegation::delegatable, ({
{sfMPTokenIssuanceID, soeREQUIRED}, {sfMPTokenIssuanceID, soeREQUIRED},
})) }))
/** This transaction type sets flags on a MPTokensIssuance or MPToken instance */ /** This transaction type sets flags on a MPTokensIssuance or MPToken instance */
TRANSACTION(ttMPTOKEN_ISSUANCE_SET, 56, MPTokenIssuanceSet, ({ TRANSACTION(ttMPTOKEN_ISSUANCE_SET, 56, MPTokenIssuanceSet, Delegation::delegatable, ({
{sfMPTokenIssuanceID, soeREQUIRED}, {sfMPTokenIssuanceID, soeREQUIRED},
{sfHolder, soeOPTIONAL}, {sfHolder, soeOPTIONAL},
})) }))
/** This transaction type authorizes a MPToken instance */ /** This transaction type authorizes a MPToken instance */
TRANSACTION(ttMPTOKEN_AUTHORIZE, 57, MPTokenAuthorize, ({ TRANSACTION(ttMPTOKEN_AUTHORIZE, 57, MPTokenAuthorize, Delegation::delegatable, ({
{sfMPTokenIssuanceID, soeREQUIRED}, {sfMPTokenIssuanceID, soeREQUIRED},
{sfHolder, soeOPTIONAL}, {sfHolder, soeOPTIONAL},
})) }))
/** This transaction type create an Credential instance */ /** This transaction type create an Credential instance */
TRANSACTION(ttCREDENTIAL_CREATE, 58, CredentialCreate, ({ TRANSACTION(ttCREDENTIAL_CREATE, 58, CredentialCreate, Delegation::delegatable, ({
{sfSubject, soeREQUIRED}, {sfSubject, soeREQUIRED},
{sfCredentialType, soeREQUIRED}, {sfCredentialType, soeREQUIRED},
{sfExpiration, soeOPTIONAL}, {sfExpiration, soeOPTIONAL},
@@ -435,38 +435,44 @@ TRANSACTION(ttCREDENTIAL_CREATE, 58, CredentialCreate, ({
})) }))
/** This transaction type accept an Credential object */ /** This transaction type accept an Credential object */
TRANSACTION(ttCREDENTIAL_ACCEPT, 59, CredentialAccept, ({ TRANSACTION(ttCREDENTIAL_ACCEPT, 59, CredentialAccept, Delegation::delegatable, ({
{sfIssuer, soeREQUIRED}, {sfIssuer, soeREQUIRED},
{sfCredentialType, soeREQUIRED}, {sfCredentialType, soeREQUIRED},
})) }))
/** This transaction type delete an Credential object */ /** This transaction type delete an Credential object */
TRANSACTION(ttCREDENTIAL_DELETE, 60, CredentialDelete, ({ TRANSACTION(ttCREDENTIAL_DELETE, 60, CredentialDelete, Delegation::delegatable, ({
{sfSubject, soeOPTIONAL}, {sfSubject, soeOPTIONAL},
{sfIssuer, soeOPTIONAL}, {sfIssuer, soeOPTIONAL},
{sfCredentialType, soeREQUIRED}, {sfCredentialType, soeREQUIRED},
})) }))
/** This transaction type modify a NFToken */ /** This transaction type modify a NFToken */
TRANSACTION(ttNFTOKEN_MODIFY, 61, NFTokenModify, ({ TRANSACTION(ttNFTOKEN_MODIFY, 61, NFTokenModify, Delegation::delegatable, ({
{sfNFTokenID, soeREQUIRED}, {sfNFTokenID, soeREQUIRED},
{sfOwner, soeOPTIONAL}, {sfOwner, soeOPTIONAL},
{sfURI, soeOPTIONAL}, {sfURI, soeOPTIONAL},
})) }))
/** This transaction type creates or modifies a Permissioned Domain */ /** This transaction type creates or modifies a Permissioned Domain */
TRANSACTION(ttPERMISSIONED_DOMAIN_SET, 62, PermissionedDomainSet, ({ TRANSACTION(ttPERMISSIONED_DOMAIN_SET, 62, PermissionedDomainSet, Delegation::delegatable, ({
{sfDomainID, soeOPTIONAL}, {sfDomainID, soeOPTIONAL},
{sfAcceptedCredentials, soeREQUIRED}, {sfAcceptedCredentials, soeREQUIRED},
})) }))
/** This transaction type deletes a Permissioned Domain */ /** This transaction type deletes a Permissioned Domain */
TRANSACTION(ttPERMISSIONED_DOMAIN_DELETE, 63, PermissionedDomainDelete, ({ TRANSACTION(ttPERMISSIONED_DOMAIN_DELETE, 63, PermissionedDomainDelete, Delegation::delegatable, ({
{sfDomainID, soeREQUIRED}, {sfDomainID, soeREQUIRED},
})) }))
/** This transaction type delegates authorized account specified permissions */
TRANSACTION(ttDELEGATE_SET, 64, DelegateSet, Delegation::notDelegatable, ({
{sfAuthorize, soeREQUIRED},
{sfPermissions, soeREQUIRED},
}))
/** This transaction creates a single asset vault. */ /** This transaction creates a single asset vault. */
TRANSACTION(ttVAULT_CREATE, 64, VaultCreate, ({ TRANSACTION(ttVAULT_CREATE, 65, VaultCreate, Delegation::delegatable, ({
{sfAsset, soeREQUIRED, soeMPTSupported}, {sfAsset, soeREQUIRED, soeMPTSupported},
{sfAssetsMaximum, soeOPTIONAL}, {sfAssetsMaximum, soeOPTIONAL},
{sfMPTokenMetadata, soeOPTIONAL}, {sfMPTokenMetadata, soeOPTIONAL},
@@ -476,7 +482,7 @@ TRANSACTION(ttVAULT_CREATE, 64, VaultCreate, ({
})) }))
/** This transaction updates a single asset vault. */ /** This transaction updates a single asset vault. */
TRANSACTION(ttVAULT_SET, 65, VaultSet, ({ TRANSACTION(ttVAULT_SET, 66, VaultSet, Delegation::delegatable, ({
{sfVaultID, soeREQUIRED}, {sfVaultID, soeREQUIRED},
{sfAssetsMaximum, soeOPTIONAL}, {sfAssetsMaximum, soeOPTIONAL},
{sfDomainID, soeOPTIONAL}, // PermissionedDomainID {sfDomainID, soeOPTIONAL}, // PermissionedDomainID
@@ -484,25 +490,25 @@ TRANSACTION(ttVAULT_SET, 65, VaultSet, ({
})) }))
/** This transaction deletes a single asset vault. */ /** This transaction deletes a single asset vault. */
TRANSACTION(ttVAULT_DELETE, 66, VaultDelete, ({ TRANSACTION(ttVAULT_DELETE, 67, VaultDelete, Delegation::delegatable, ({
{sfVaultID, soeREQUIRED}, {sfVaultID, soeREQUIRED},
})) }))
/** This transaction trades assets for shares with a vault. */ /** This transaction trades assets for shares with a vault. */
TRANSACTION(ttVAULT_DEPOSIT, 67, VaultDeposit, ({ TRANSACTION(ttVAULT_DEPOSIT, 68, VaultDeposit, Delegation::delegatable, ({
{sfVaultID, soeREQUIRED}, {sfVaultID, soeREQUIRED},
{sfAmount, soeREQUIRED, soeMPTSupported}, {sfAmount, soeREQUIRED, soeMPTSupported},
})) }))
/** This transaction trades shares for assets with a vault. */ /** This transaction trades shares for assets with a vault. */
TRANSACTION(ttVAULT_WITHDRAW, 68, VaultWithdraw, ({ TRANSACTION(ttVAULT_WITHDRAW, 69, VaultWithdraw, Delegation::delegatable, ({
{sfVaultID, soeREQUIRED}, {sfVaultID, soeREQUIRED},
{sfAmount, soeREQUIRED, soeMPTSupported}, {sfAmount, soeREQUIRED, soeMPTSupported},
{sfDestination, soeOPTIONAL}, {sfDestination, soeOPTIONAL},
})) }))
/** This transaction claws back tokens from a vault. */ /** This transaction claws back tokens from a vault. */
TRANSACTION(ttVAULT_CLAWBACK, 69, VaultClawback, ({ TRANSACTION(ttVAULT_CLAWBACK, 70, VaultClawback, Delegation::delegatable, ({
{sfVaultID, soeREQUIRED}, {sfVaultID, soeREQUIRED},
{sfHolder, soeREQUIRED}, {sfHolder, soeREQUIRED},
{sfAmount, soeOPTIONAL, soeMPTSupported}, {sfAmount, soeOPTIONAL, soeMPTSupported},
@@ -512,7 +518,7 @@ TRANSACTION(ttVAULT_CLAWBACK, 69, VaultClawback, ({
For details, see: https://xrpl.org/amendments.html For details, see: https://xrpl.org/amendments.html
*/ */
TRANSACTION(ttAMENDMENT, 100, EnableAmendment, ({ TRANSACTION(ttAMENDMENT, 100, EnableAmendment, Delegation::notDelegatable, ({
{sfLedgerSequence, soeREQUIRED}, {sfLedgerSequence, soeREQUIRED},
{sfAmendment, soeREQUIRED}, {sfAmendment, soeREQUIRED},
})) }))
@@ -520,7 +526,7 @@ TRANSACTION(ttAMENDMENT, 100, EnableAmendment, ({
/** This system-generated transaction type is used to update the network's fee settings. /** This system-generated transaction type is used to update the network's fee settings.
For details, see: https://xrpl.org/fee-voting.html For details, see: https://xrpl.org/fee-voting.html
*/ */
TRANSACTION(ttFEE, 101, SetFee, ({ TRANSACTION(ttFEE, 101, SetFee, Delegation::notDelegatable, ({
{sfLedgerSequence, soeOPTIONAL}, {sfLedgerSequence, soeOPTIONAL},
// Old version uses raw numbers // Old version uses raw numbers
{sfBaseFee, soeOPTIONAL}, {sfBaseFee, soeOPTIONAL},
@@ -537,7 +543,7 @@ TRANSACTION(ttFEE, 101, SetFee, ({
For details, see: https://xrpl.org/negative-unl.html For details, see: https://xrpl.org/negative-unl.html
*/ */
TRANSACTION(ttUNL_MODIFY, 102, UNLModify, ({ TRANSACTION(ttUNL_MODIFY, 102, UNLModify, Delegation::notDelegatable, ({
{sfUNLModifyDisabling, soeREQUIRED}, {sfUNLModifyDisabling, soeREQUIRED},
{sfLedgerSequence, soeREQUIRED}, {sfLedgerSequence, soeREQUIRED},
{sfUNLModifyValidator, soeREQUIRED}, {sfUNLModifyValidator, soeREQUIRED},

View File

@@ -20,7 +20,7 @@ struct JsonMissingKeyError : std::exception
JsonMissingKeyError(Json::StaticString const& k) : key{k.c_str()} JsonMissingKeyError(Json::StaticString const& k) : key{k.c_str()}
{ {
} }
const char* char const*
what() const noexcept override what() const noexcept override
{ {
if (msg.empty()) if (msg.empty())
@@ -40,7 +40,7 @@ struct JsonTypeMismatchError : std::exception
: key{k.c_str()}, expectedType{std::move(et)} : key{k.c_str()}, expectedType{std::move(et)}
{ {
} }
const char* char const*
what() const noexcept override what() const noexcept override
{ {
if (msg.empty()) if (msg.empty())

View File

@@ -89,7 +89,6 @@ JSS(SettleDelay); // in: TransactionSign
JSS(SendMax); // in: TransactionSign JSS(SendMax); // in: TransactionSign
JSS(Sequence); // in/out: TransactionSign; field. JSS(Sequence); // in/out: TransactionSign; field.
JSS(SetFlag); // field. JSS(SetFlag); // field.
JSS(SharesTotal); // out: Vault
JSS(Signer); // field. JSS(Signer); // field.
JSS(Signers); // field. JSS(Signers); // field.
JSS(SigningPubKey); // field. JSS(SigningPubKey); // field.
@@ -101,7 +100,6 @@ JSS(TransactionType); // in: TransactionSign.
JSS(TransferRate); // in: TransferRate. JSS(TransferRate); // in: TransferRate.
JSS(TxnSignature); // field. JSS(TxnSignature); // field.
JSS(URI); // field. JSS(URI); // field.
JSS(VaultID); // field.
JSS(VoteSlots); // out: AMM Vote JSS(VoteSlots); // out: AMM Vote
JSS(aborted); // out: InboundLedger JSS(aborted); // out: InboundLedger
JSS(accepted); // out: LedgerToJson, OwnerInfo, SubmitTransaction JSS(accepted); // out: LedgerToJson, OwnerInfo, SubmitTransaction
@@ -147,6 +145,7 @@ JSS(attestations);
JSS(attestation_reward_account); JSS(attestation_reward_account);
JSS(auction_slot); // out: amm_info JSS(auction_slot); // out: amm_info
JSS(authorized); // out: AccountLines JSS(authorized); // out: AccountLines
JSS(authorize); // out: delegate
JSS(authorized_credentials); // in: ledger_entry DepositPreauth JSS(authorized_credentials); // in: ledger_entry DepositPreauth
JSS(auth_accounts); // out: amm_info JSS(auth_accounts); // out: amm_info
JSS(auth_change); // out: AccountInfo JSS(auth_change); // out: AccountInfo
@@ -687,6 +686,7 @@ JSS(validations); // out: AmendmentTableImpl
JSS(validator_list_threshold); // out: ValidatorList JSS(validator_list_threshold); // out: ValidatorList
JSS(validator_sites); // out: ValidatorSites JSS(validator_sites); // out: ValidatorSites
JSS(value); // out: STAmount JSS(value); // out: STAmount
JSS(vault_id); // in: VaultInfo
JSS(version); // out: RPCVersion JSS(version); // out: RPCVersion
JSS(vetoed); // out: AmendmentTableImpl JSS(vetoed); // out: AmendmentTableImpl
JSS(volume_a); // out: BookChanges JSS(volume_a); // out: BookChanges
@@ -703,7 +703,7 @@ JSS(write_load); // out: GetCounts
#pragma push_macro("TRANSACTION") #pragma push_macro("TRANSACTION")
#undef TRANSACTION #undef TRANSACTION
#define TRANSACTION(tag, value, name, fields) JSS(name); #define TRANSACTION(tag, value, name, delegatable, fields) JSS(name);
#include <xrpl/protocol/detail/transactions.macro> #include <xrpl/protocol/detail/transactions.macro>
@@ -730,8 +730,6 @@ JSS(write_load); // out: GetCounts
#undef JSS #undef JSS
// clang-format on
} // namespace jss } // namespace jss
} // namespace ripple } // namespace ripple

View File

@@ -94,7 +94,7 @@ extractTarLz4(
if (archive_entry_size(entry) > 0) if (archive_entry_size(entry) > 0)
{ {
const void* buf; void const* buf;
size_t sz; size_t sz;
la_int64_t offset; la_int64_t offset;
while (true) while (true)

View File

@@ -63,7 +63,7 @@ getFileContents(
return {}; return {};
} }
const std::string result{ std::string const result{
std::istreambuf_iterator<char>{fileStream}, std::istreambuf_iterator<char>{fileStream},
std::istreambuf_iterator<char>{}}; std::istreambuf_iterator<char>{}};

View File

@@ -469,7 +469,7 @@ Number::operator/=(Number const& y)
} }
// Shift by 10^17 gives greatest precision while not overflowing uint128_t // Shift by 10^17 gives greatest precision while not overflowing uint128_t
// or the cast back to int64_t // or the cast back to int64_t
const uint128_t f = 100'000'000'000'000'000; uint128_t const f = 100'000'000'000'000'000;
mantissa_ = static_cast<std::int64_t>(uint128_t(nm) * f / uint128_t(dm)); mantissa_ = static_cast<std::int64_t>(uint128_t(nm) * f / uint128_t(dm));
exponent_ = ne - de - 17; exponent_ = ne - de - 17;
mantissa_ *= np * dp; mantissa_ *= np * dp;

View File

@@ -89,13 +89,13 @@ parseUrl(parsedURL& pUrl, std::string const& strUrl)
boost::algorithm::to_lower(pUrl.scheme); boost::algorithm::to_lower(pUrl.scheme);
pUrl.username = smMatch[2]; pUrl.username = smMatch[2];
pUrl.password = smMatch[3]; pUrl.password = smMatch[3];
const std::string domain = smMatch[4]; std::string const domain = smMatch[4];
// We need to use Endpoint to parse the domain to // We need to use Endpoint to parse the domain to
// strip surrounding brackets from IPv6 addresses, // strip surrounding brackets from IPv6 addresses,
// e.g. [::1] => ::1. // e.g. [::1] => ::1.
const auto result = beast::IP::Endpoint::from_string_checked(domain); auto const result = beast::IP::Endpoint::from_string_checked(domain);
pUrl.domain = result ? result->address().to_string() : domain; pUrl.domain = result ? result->address().to_string() : domain;
const std::string port = smMatch[5]; std::string const port = smMatch[5];
if (!port.empty()) if (!port.empty())
{ {
pUrl.port = beast::lexicalCast<std::uint16_t>(port); pUrl.port = beast::lexicalCast<std::uint16_t>(port);

View File

@@ -67,7 +67,7 @@ UptimeClock::time_point
UptimeClock::now() UptimeClock::now()
{ {
// start the update thread on first use // start the update thread on first use
static const auto init = start_clock(); static auto const init = start_clock();
// Return the number of seconds since rippled start // Return the number of seconds since rippled start
return time_point{duration{now_}}; return time_point{duration{now_}};

View File

@@ -31,9 +31,7 @@ namespace ripple {
std::optional<std::uint64_t> std::optional<std::uint64_t>
mulDiv(std::uint64_t value, std::uint64_t mul, std::uint64_t div) mulDiv(std::uint64_t value, std::uint64_t mul, std::uint64_t div)
{ {
using namespace boost::multiprecision; boost::multiprecision::uint128_t result;
uint128_t result;
result = multiply(result, value, mul); result = multiply(result, value, mul);
result /= div; result /= div;

View File

@@ -34,7 +34,7 @@ namespace Json {
namespace { namespace {
std::map<char, const char*> jsonSpecialCharacterEscape = { std::map<char, char const*> jsonSpecialCharacterEscape = {
{'"', "\\\""}, {'"', "\\\""},
{'\\', "\\\\"}, {'\\', "\\\\"},
{'/', "\\/"}, {'/', "\\/"},
@@ -47,13 +47,13 @@ std::map<char, const char*> jsonSpecialCharacterEscape = {
static size_t const jsonEscapeLength = 2; static size_t const jsonEscapeLength = 2;
// All other JSON punctuation. // All other JSON punctuation.
const char closeBrace = '}'; char const closeBrace = '}';
const char closeBracket = ']'; char const closeBracket = ']';
const char colon = ':'; char const colon = ':';
const char comma = ','; char const comma = ',';
const char openBrace = '{'; char const openBrace = '{';
const char openBracket = '['; char const openBracket = '[';
const char quote = '"'; char const quote = '"';
static auto const integralFloatsBecomeInts = false; static auto const integralFloatsBecomeInts = false;

View File

@@ -78,8 +78,8 @@ bool
Reader::parse(std::string const& document, Value& root) Reader::parse(std::string const& document, Value& root)
{ {
document_ = document; document_ = document;
const char* begin = document_.c_str(); char const* begin = document_.c_str();
const char* end = begin + document_.length(); char const* end = begin + document_.length();
return parse(begin, end, root); return parse(begin, end, root);
} }
@@ -99,7 +99,7 @@ Reader::parse(std::istream& sin, Value& root)
} }
bool bool
Reader::parse(const char* beginDoc, const char* endDoc, Value& root) Reader::parse(char const* beginDoc, char const* endDoc, Value& root)
{ {
begin_ = beginDoc; begin_ = beginDoc;
end_ = endDoc; end_ = endDoc;
@@ -193,7 +193,7 @@ Reader::skipCommentTokens(Token& token)
} }
bool bool
Reader::expectToken(TokenType type, Token& token, const char* message) Reader::expectToken(TokenType type, Token& token, char const* message)
{ {
readToken(token); readToken(token);
@@ -629,7 +629,7 @@ bool
Reader::decodeDouble(Token& token) Reader::decodeDouble(Token& token)
{ {
double value = 0; double value = 0;
const int bufferSize = 32; int const bufferSize = 32;
int count; int count;
int length = int(token.end_ - token.start_); int length = int(token.end_ - token.start_);
// Sanity check to avoid buffer overflow exploits. // Sanity check to avoid buffer overflow exploits.
@@ -939,7 +939,7 @@ Reader::getFormatedErrorMessages() const
itError != errors_.end(); itError != errors_.end();
++itError) ++itError)
{ {
const ErrorInfo& error = *itError; ErrorInfo const& error = *itError;
formattedMessage += formattedMessage +=
"* " + getLocationLineAndColumn(error.token_.start_) + "\n"; "* " + getLocationLineAndColumn(error.token_.start_) + "\n";
formattedMessage += " " + error.message_ + "\n"; formattedMessage += " " + error.message_ + "\n";

View File

@@ -31,10 +31,10 @@
namespace Json { namespace Json {
const Value Value::null; Value const Value::null;
const Int Value::minInt = Int(~(UInt(-1) / 2)); Int const Value::minInt = Int(~(UInt(-1) / 2));
const Int Value::maxInt = Int(UInt(-1) / 2); Int const Value::maxInt = Int(UInt(-1) / 2);
const UInt Value::maxUInt = UInt(-1); UInt const Value::maxUInt = UInt(-1);
class DefaultValueAllocator : public ValueAllocator class DefaultValueAllocator : public ValueAllocator
{ {
@@ -42,7 +42,7 @@ public:
virtual ~DefaultValueAllocator() = default; virtual ~DefaultValueAllocator() = default;
char* char*
makeMemberName(const char* memberName) override makeMemberName(char const* memberName) override
{ {
return duplicateStringValue(memberName); return duplicateStringValue(memberName);
} }
@@ -54,7 +54,7 @@ public:
} }
char* char*
duplicateStringValue(const char* value, unsigned int length = unknown) duplicateStringValue(char const* value, unsigned int length = unknown)
override override
{ {
//@todo investigate this old optimization //@todo investigate this old optimization
@@ -110,14 +110,14 @@ Value::CZString::CZString(int index) : cstr_(0), index_(index)
{ {
} }
Value::CZString::CZString(const char* cstr, DuplicationPolicy allocate) Value::CZString::CZString(char const* cstr, DuplicationPolicy allocate)
: cstr_( : cstr_(
allocate == duplicate ? valueAllocator()->makeMemberName(cstr) : cstr) allocate == duplicate ? valueAllocator()->makeMemberName(cstr) : cstr)
, index_(allocate) , index_(allocate)
{ {
} }
Value::CZString::CZString(const CZString& other) Value::CZString::CZString(CZString const& other)
: cstr_( : cstr_(
other.index_ != noDuplication && other.cstr_ != 0 other.index_ != noDuplication && other.cstr_ != 0
? valueAllocator()->makeMemberName(other.cstr_) ? valueAllocator()->makeMemberName(other.cstr_)
@@ -136,7 +136,7 @@ Value::CZString::~CZString()
} }
bool bool
Value::CZString::operator<(const CZString& other) const Value::CZString::operator<(CZString const& other) const
{ {
if (cstr_ && other.cstr_) if (cstr_ && other.cstr_)
return strcmp(cstr_, other.cstr_) < 0; return strcmp(cstr_, other.cstr_) < 0;
@@ -145,7 +145,7 @@ Value::CZString::operator<(const CZString& other) const
} }
bool bool
Value::CZString::operator==(const CZString& other) const Value::CZString::operator==(CZString const& other) const
{ {
if (cstr_ && other.cstr_) if (cstr_ && other.cstr_)
return strcmp(cstr_, other.cstr_) == 0; return strcmp(cstr_, other.cstr_) == 0;
@@ -159,7 +159,7 @@ Value::CZString::index() const
return index_; return index_;
} }
const char* char const*
Value::CZString::c_str() const Value::CZString::c_str() const
{ {
return cstr_; return cstr_;
@@ -232,7 +232,7 @@ Value::Value(double value) : type_(realValue)
value_.real_ = value; value_.real_ = value;
} }
Value::Value(const char* value) : type_(stringValue), allocated_(true) Value::Value(char const* value) : type_(stringValue), allocated_(true)
{ {
value_.string_ = valueAllocator()->duplicateStringValue(value); value_.string_ = valueAllocator()->duplicateStringValue(value);
} }
@@ -250,7 +250,7 @@ Value::Value(std::string const& value) : type_(stringValue), allocated_(true)
value.c_str(), (unsigned int)value.length()); value.c_str(), (unsigned int)value.length());
} }
Value::Value(const StaticString& value) : type_(stringValue), allocated_(false) Value::Value(StaticString const& value) : type_(stringValue), allocated_(false)
{ {
value_.string_ = const_cast<char*>(value.c_str()); value_.string_ = const_cast<char*>(value.c_str());
} }
@@ -260,7 +260,7 @@ Value::Value(bool value) : type_(booleanValue)
value_.bool_ = value; value_.bool_ = value;
} }
Value::Value(const Value& other) : type_(other.type_) Value::Value(Value const& other) : type_(other.type_)
{ {
switch (type_) switch (type_)
{ {
@@ -377,7 +377,7 @@ integerCmp(Int i, UInt ui)
} }
bool bool
operator<(const Value& x, const Value& y) operator<(Value const& x, Value const& y)
{ {
if (auto signum = x.type_ - y.type_) if (auto signum = x.type_ - y.type_)
{ {
@@ -426,7 +426,7 @@ operator<(const Value& x, const Value& y)
} }
bool bool
operator==(const Value& x, const Value& y) operator==(Value const& x, Value const& y)
{ {
if (x.type_ != y.type_) if (x.type_ != y.type_)
{ {
@@ -471,7 +471,7 @@ operator==(const Value& x, const Value& y)
return 0; // unreachable return 0; // unreachable
} }
const char* char const*
Value::asCString() const Value::asCString() const
{ {
XRPL_ASSERT(type_ == stringValue, "Json::Value::asCString : valid type"); XRPL_ASSERT(type_ == stringValue, "Json::Value::asCString : valid type");
@@ -802,7 +802,7 @@ Value::operator[](UInt index)
return (*it).second; return (*it).second;
} }
const Value& Value const&
Value::operator[](UInt index) const Value::operator[](UInt index) const
{ {
XRPL_ASSERT( XRPL_ASSERT(
@@ -822,13 +822,13 @@ Value::operator[](UInt index) const
} }
Value& Value&
Value::operator[](const char* key) Value::operator[](char const* key)
{ {
return resolveReference(key, false); return resolveReference(key, false);
} }
Value& Value&
Value::resolveReference(const char* key, bool isStatic) Value::resolveReference(char const* key, bool isStatic)
{ {
XRPL_ASSERT( XRPL_ASSERT(
type_ == nullValue || type_ == objectValue, type_ == nullValue || type_ == objectValue,
@@ -851,9 +851,9 @@ Value::resolveReference(const char* key, bool isStatic)
} }
Value Value
Value::get(UInt index, const Value& defaultValue) const Value::get(UInt index, Value const& defaultValue) const
{ {
const Value* value = &((*this)[index]); Value const* value = &((*this)[index]);
return value == &null ? defaultValue : *value; return value == &null ? defaultValue : *value;
} }
@@ -863,8 +863,8 @@ Value::isValidIndex(UInt index) const
return index < size(); return index < size();
} }
const Value& Value const&
Value::operator[](const char* key) const Value::operator[](char const* key) const
{ {
XRPL_ASSERT( XRPL_ASSERT(
type_ == nullValue || type_ == objectValue, type_ == nullValue || type_ == objectValue,
@@ -888,26 +888,26 @@ Value::operator[](std::string const& key)
return (*this)[key.c_str()]; return (*this)[key.c_str()];
} }
const Value& Value const&
Value::operator[](std::string const& key) const Value::operator[](std::string const& key) const
{ {
return (*this)[key.c_str()]; return (*this)[key.c_str()];
} }
Value& Value&
Value::operator[](const StaticString& key) Value::operator[](StaticString const& key)
{ {
return resolveReference(key, true); return resolveReference(key, true);
} }
Value const& Value const&
Value::operator[](const StaticString& key) const Value::operator[](StaticString const& key) const
{ {
return (*this)[key.c_str()]; return (*this)[key.c_str()];
} }
Value& Value&
Value::append(const Value& value) Value::append(Value const& value)
{ {
return (*this)[size()] = value; return (*this)[size()] = value;
} }
@@ -919,20 +919,20 @@ Value::append(Value&& value)
} }
Value Value
Value::get(const char* key, const Value& defaultValue) const Value::get(char const* key, Value const& defaultValue) const
{ {
const Value* value = &((*this)[key]); Value const* value = &((*this)[key]);
return value == &null ? defaultValue : *value; return value == &null ? defaultValue : *value;
} }
Value Value
Value::get(std::string const& key, const Value& defaultValue) const Value::get(std::string const& key, Value const& defaultValue) const
{ {
return get(key.c_str(), defaultValue); return get(key.c_str(), defaultValue);
} }
Value Value
Value::removeMember(const char* key) Value::removeMember(char const* key)
{ {
XRPL_ASSERT( XRPL_ASSERT(
type_ == nullValue || type_ == objectValue, type_ == nullValue || type_ == objectValue,
@@ -959,12 +959,12 @@ Value::removeMember(std::string const& key)
} }
bool bool
Value::isMember(const char* key) const Value::isMember(char const* key) const
{ {
if (type_ != objectValue) if (type_ != objectValue)
return false; return false;
const Value* value = &((*this)[key]); Value const* value = &((*this)[key]);
return value != &null; return value != &null;
} }

View File

@@ -37,7 +37,7 @@ ValueIteratorBase::ValueIteratorBase() : current_(), isNull_(true)
} }
ValueIteratorBase::ValueIteratorBase( ValueIteratorBase::ValueIteratorBase(
const Value::ObjectValues::iterator& current) Value::ObjectValues::iterator const& current)
: current_(current), isNull_(false) : current_(current), isNull_(false)
{ {
} }
@@ -61,7 +61,7 @@ ValueIteratorBase::decrement()
} }
ValueIteratorBase::difference_type ValueIteratorBase::difference_type
ValueIteratorBase::computeDistance(const SelfType& other) const ValueIteratorBase::computeDistance(SelfType const& other) const
{ {
// Iterator for null value are initialized using the default // Iterator for null value are initialized using the default
// constructor, which initialize current_ to the default // constructor, which initialize current_ to the default
@@ -89,7 +89,7 @@ ValueIteratorBase::computeDistance(const SelfType& other) const
} }
bool bool
ValueIteratorBase::isEqual(const SelfType& other) const ValueIteratorBase::isEqual(SelfType const& other) const
{ {
if (isNull_) if (isNull_)
{ {
@@ -100,7 +100,7 @@ ValueIteratorBase::isEqual(const SelfType& other) const
} }
void void
ValueIteratorBase::copy(const SelfType& other) ValueIteratorBase::copy(SelfType const& other)
{ {
current_ = other.current_; current_ = other.current_;
} }
@@ -108,7 +108,7 @@ ValueIteratorBase::copy(const SelfType& other)
Value Value
ValueIteratorBase::key() const ValueIteratorBase::key() const
{ {
const Value::CZString czstring = (*current_).first; Value::CZString const czstring = (*current_).first;
if (czstring.c_str()) if (czstring.c_str())
{ {
@@ -124,7 +124,7 @@ ValueIteratorBase::key() const
UInt UInt
ValueIteratorBase::index() const ValueIteratorBase::index() const
{ {
const Value::CZString czstring = (*current_).first; Value::CZString const czstring = (*current_).first;
if (!czstring.c_str()) if (!czstring.c_str())
return czstring.index(); return czstring.index();
@@ -132,10 +132,10 @@ ValueIteratorBase::index() const
return Value::UInt(-1); return Value::UInt(-1);
} }
const char* char const*
ValueIteratorBase::memberName() const ValueIteratorBase::memberName() const
{ {
const char* name = (*current_).first.c_str(); char const* name = (*current_).first.c_str();
return name ? name : ""; return name ? name : "";
} }
@@ -148,13 +148,13 @@ ValueIteratorBase::memberName() const
// ////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////
ValueConstIterator::ValueConstIterator( ValueConstIterator::ValueConstIterator(
const Value::ObjectValues::iterator& current) Value::ObjectValues::iterator const& current)
: ValueIteratorBase(current) : ValueIteratorBase(current)
{ {
} }
ValueConstIterator& ValueConstIterator&
ValueConstIterator::operator=(const ValueIteratorBase& other) ValueConstIterator::operator=(ValueIteratorBase const& other)
{ {
copy(other); copy(other);
return *this; return *this;
@@ -168,23 +168,23 @@ ValueConstIterator::operator=(const ValueIteratorBase& other)
// ////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////
ValueIterator::ValueIterator(const Value::ObjectValues::iterator& current) ValueIterator::ValueIterator(Value::ObjectValues::iterator const& current)
: ValueIteratorBase(current) : ValueIteratorBase(current)
{ {
} }
ValueIterator::ValueIterator(const ValueConstIterator& other) ValueIterator::ValueIterator(ValueConstIterator const& other)
: ValueIteratorBase(other) : ValueIteratorBase(other)
{ {
} }
ValueIterator::ValueIterator(const ValueIterator& other) ValueIterator::ValueIterator(ValueIterator const& other)
: ValueIteratorBase(other) : ValueIteratorBase(other)
{ {
} }
ValueIterator& ValueIterator&
ValueIterator::operator=(const SelfType& other) ValueIterator::operator=(SelfType const& other)
{ {
copy(other); copy(other);
return *this; return *this;

View File

@@ -40,7 +40,7 @@ isControlCharacter(char ch)
} }
static bool static bool
containsControlCharacter(const char* str) containsControlCharacter(char const* str)
{ {
while (*str) while (*str)
{ {
@@ -117,7 +117,7 @@ valueToString(bool value)
} }
std::string std::string
valueToQuotedString(const char* value) valueToQuotedString(char const* value)
{ {
// Not sure how to handle unicode... // Not sure how to handle unicode...
if (strpbrk(value, "\"\\\b\f\n\r\t") == nullptr && if (strpbrk(value, "\"\\\b\f\n\r\t") == nullptr &&
@@ -132,7 +132,7 @@ valueToQuotedString(const char* value)
result.reserve(maxsize); // to avoid lots of mallocs result.reserve(maxsize); // to avoid lots of mallocs
result += "\""; result += "\"";
for (const char* c = value; *c != 0; ++c) for (char const* c = value; *c != 0; ++c)
{ {
switch (*c) switch (*c)
{ {
@@ -197,7 +197,7 @@ valueToQuotedString(const char* value)
// ////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////
std::string std::string
FastWriter::write(const Value& root) FastWriter::write(Value const& root)
{ {
document_ = ""; document_ = "";
writeValue(root); writeValue(root);
@@ -205,7 +205,7 @@ FastWriter::write(const Value& root)
} }
void void
FastWriter::writeValue(const Value& value) FastWriter::writeValue(Value const& value)
{ {
switch (value.type()) switch (value.type())
{ {
@@ -281,7 +281,7 @@ StyledWriter::StyledWriter() : rightMargin_(74), indentSize_(3)
} }
std::string std::string
StyledWriter::write(const Value& root) StyledWriter::write(Value const& root)
{ {
document_ = ""; document_ = "";
addChildValues_ = false; addChildValues_ = false;
@@ -292,7 +292,7 @@ StyledWriter::write(const Value& root)
} }
void void
StyledWriter::writeValue(const Value& value) StyledWriter::writeValue(Value const& value)
{ {
switch (value.type()) switch (value.type())
{ {
@@ -338,7 +338,7 @@ StyledWriter::writeValue(const Value& value)
while (true) while (true)
{ {
std::string const& name = *it; std::string const& name = *it;
const Value& childValue = value[name]; Value const& childValue = value[name];
writeWithIndent(valueToQuotedString(name.c_str())); writeWithIndent(valueToQuotedString(name.c_str()));
document_ += " : "; document_ += " : ";
writeValue(childValue); writeValue(childValue);
@@ -358,7 +358,7 @@ StyledWriter::writeValue(const Value& value)
} }
void void
StyledWriter::writeArrayValue(const Value& value) StyledWriter::writeArrayValue(Value const& value)
{ {
unsigned size = value.size(); unsigned size = value.size();
@@ -377,7 +377,7 @@ StyledWriter::writeArrayValue(const Value& value)
while (true) while (true)
{ {
const Value& childValue = value[index]; Value const& childValue = value[index];
if (hasChildValue) if (hasChildValue)
writeWithIndent(childValues_[index]); writeWithIndent(childValues_[index]);
@@ -417,7 +417,7 @@ StyledWriter::writeArrayValue(const Value& value)
} }
bool bool
StyledWriter::isMultineArray(const Value& value) StyledWriter::isMultineArray(Value const& value)
{ {
int size = value.size(); int size = value.size();
bool isMultiLine = size * 3 >= rightMargin_; bool isMultiLine = size * 3 >= rightMargin_;
@@ -425,7 +425,7 @@ StyledWriter::isMultineArray(const Value& value)
for (int index = 0; index < size && !isMultiLine; ++index) for (int index = 0; index < size && !isMultiLine; ++index)
{ {
const Value& childValue = value[index]; Value const& childValue = value[index];
isMultiLine = isMultiLine || isMultiLine = isMultiLine ||
((childValue.isArray() || childValue.isObject()) && ((childValue.isArray() || childValue.isObject()) &&
childValue.size() > 0); childValue.size() > 0);
@@ -507,7 +507,7 @@ StyledStreamWriter::StyledStreamWriter(std::string indentation)
} }
void void
StyledStreamWriter::write(std::ostream& out, const Value& root) StyledStreamWriter::write(std::ostream& out, Value const& root)
{ {
document_ = &out; document_ = &out;
addChildValues_ = false; addChildValues_ = false;
@@ -518,7 +518,7 @@ StyledStreamWriter::write(std::ostream& out, const Value& root)
} }
void void
StyledStreamWriter::writeValue(const Value& value) StyledStreamWriter::writeValue(Value const& value)
{ {
switch (value.type()) switch (value.type())
{ {
@@ -564,7 +564,7 @@ StyledStreamWriter::writeValue(const Value& value)
while (true) while (true)
{ {
std::string const& name = *it; std::string const& name = *it;
const Value& childValue = value[name]; Value const& childValue = value[name];
writeWithIndent(valueToQuotedString(name.c_str())); writeWithIndent(valueToQuotedString(name.c_str()));
*document_ << " : "; *document_ << " : ";
writeValue(childValue); writeValue(childValue);
@@ -584,7 +584,7 @@ StyledStreamWriter::writeValue(const Value& value)
} }
void void
StyledStreamWriter::writeArrayValue(const Value& value) StyledStreamWriter::writeArrayValue(Value const& value)
{ {
unsigned size = value.size(); unsigned size = value.size();
@@ -603,7 +603,7 @@ StyledStreamWriter::writeArrayValue(const Value& value)
while (true) while (true)
{ {
const Value& childValue = value[index]; Value const& childValue = value[index];
if (hasChildValue) if (hasChildValue)
writeWithIndent(childValues_[index]); writeWithIndent(childValues_[index]);
@@ -643,7 +643,7 @@ StyledStreamWriter::writeArrayValue(const Value& value)
} }
bool bool
StyledStreamWriter::isMultineArray(const Value& value) StyledStreamWriter::isMultineArray(Value const& value)
{ {
int size = value.size(); int size = value.size();
bool isMultiLine = size * 3 >= rightMargin_; bool isMultiLine = size * 3 >= rightMargin_;
@@ -651,7 +651,7 @@ StyledStreamWriter::isMultineArray(const Value& value)
for (int index = 0; index < size && !isMultiLine; ++index) for (int index = 0; index < size && !isMultiLine; ++index)
{ {
const Value& childValue = value[index]; Value const& childValue = value[index];
isMultiLine = isMultiLine || isMultiLine = isMultiLine ||
((childValue.isArray() || childValue.isObject()) && ((childValue.isArray() || childValue.isObject()) &&
childValue.size() > 0); childValue.size() > 0);
@@ -726,7 +726,7 @@ StyledStreamWriter::unindent()
} }
std::ostream& std::ostream&
operator<<(std::ostream& sout, const Value& root) operator<<(std::ostream& sout, Value const& root)
{ {
Json::StyledStreamWriter writer; Json::StyledStreamWriter writer;
writer.write(sout, root); writer.write(sout, root);

View File

@@ -36,7 +36,7 @@ namespace BuildInfo {
// and follow the format described at http://semver.org/ // and follow the format described at http://semver.org/
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// clang-format off // clang-format off
char const* const versionString = "2.4.0" char const* const versionString = "2.5.0-b1"
// clang-format on // clang-format on
#if defined(DEBUG) || defined(SANITIZER) #if defined(DEBUG) || defined(SANITIZER)

View File

@@ -96,6 +96,7 @@ constexpr static ErrorInfo unorderedErrorInfos[]{
{rpcNOT_SYNCED, "notSynced", "Not synced to the network.", 503}, {rpcNOT_SYNCED, "notSynced", "Not synced to the network.", 503},
{rpcNO_EVENTS, "noEvents", "Current transport does not support events.", 405}, {rpcNO_EVENTS, "noEvents", "Current transport does not support events.", 405},
{rpcNO_NETWORK, "noNetwork", "Not synced to the network.", 503}, {rpcNO_NETWORK, "noNetwork", "Not synced to the network.", 503},
{rpcWRONG_NETWORK, "wrongNetwork", "Wrong network.", 503},
{rpcNO_PERMISSION, "noPermission", "You don't have permission for this command.", 401}, {rpcNO_PERMISSION, "noPermission", "You don't have permission for this command.", 401},
{rpcNO_PF_REQUEST, "noPathRequest", "No pathfinding request in progress.", 404}, {rpcNO_PF_REQUEST, "noPathRequest", "No pathfinding request in progress.", 404},
{rpcOBJECT_NOT_FOUND, "objectNotFound", "The requested object was not found.", 404}, {rpcOBJECT_NOT_FOUND, "objectNotFound", "The requested object was not found.", 404},
@@ -106,6 +107,7 @@ constexpr static ErrorInfo unorderedErrorInfos[]{
{rpcSRC_ACT_MALFORMED, "srcActMalformed", "Source account is malformed.", 400}, {rpcSRC_ACT_MALFORMED, "srcActMalformed", "Source account is malformed.", 400},
{rpcSRC_ACT_MISSING, "srcActMissing", "Source account not provided.", 400}, {rpcSRC_ACT_MISSING, "srcActMissing", "Source account not provided.", 400},
{rpcSRC_ACT_NOT_FOUND, "srcActNotFound", "Source account not found.", 404}, {rpcSRC_ACT_NOT_FOUND, "srcActNotFound", "Source account not found.", 404},
{rpcDELEGATE_ACT_NOT_FOUND, "delegateActNotFound", "Delegate account not found.", 404},
{rpcSRC_CUR_MALFORMED, "srcCurMalformed", "Source currency is malformed.", 400}, {rpcSRC_CUR_MALFORMED, "srcCurMalformed", "Source currency is malformed.", 400},
{rpcSRC_ISR_MALFORMED, "srcIsrMalformed", "Source issuer is malformed.", 400}, {rpcSRC_ISR_MALFORMED, "srcIsrMalformed", "Source issuer is malformed.", 400},
{rpcSTREAM_MALFORMED, "malformedStream", "Stream malformed.", 400}, {rpcSTREAM_MALFORMED, "malformedStream", "Stream malformed.", 400},

View File

@@ -139,27 +139,27 @@ class FeatureCollections
{ {
if (i >= features.size()) if (i >= features.size())
LogicError("Invalid FeatureBitset index"); LogicError("Invalid FeatureBitset index");
const auto& sequence = features.get<Feature::byIndex>(); auto const& sequence = features.get<Feature::byIndex>();
return sequence[i]; return sequence[i];
} }
size_t size_t
getIndex(Feature const& feature) const getIndex(Feature const& feature) const
{ {
const auto& sequence = features.get<Feature::byIndex>(); auto const& sequence = features.get<Feature::byIndex>();
auto const it_to = sequence.iterator_to(feature); auto const it_to = sequence.iterator_to(feature);
return it_to - sequence.begin(); return it_to - sequence.begin();
} }
Feature const* Feature const*
getByFeature(uint256 const& feature) const getByFeature(uint256 const& feature) const
{ {
const auto& feature_index = features.get<Feature::byFeature>(); auto const& feature_index = features.get<Feature::byFeature>();
auto const feature_it = feature_index.find(feature); auto const feature_it = feature_index.find(feature);
return feature_it == feature_index.end() ? nullptr : &*feature_it; return feature_it == feature_index.end() ? nullptr : &*feature_it;
} }
Feature const* Feature const*
getByName(std::string const& name) const getByName(std::string const& name) const
{ {
const auto& name_index = features.get<Feature::byName>(); auto const& name_index = features.get<Feature::byName>();
auto const name_it = name_index.find(name); auto const name_it = name_index.find(name);
return name_it == name_index.end() ? nullptr : &*name_it; return name_it == name_index.end() ? nullptr : &*name_it;
} }
@@ -240,7 +240,7 @@ FeatureCollections::getRegisteredFeature(std::string const& name) const
} }
void void
check(bool condition, const char* logicErrorMessage) check(bool condition, char const* logicErrorMessage)
{ {
if (!condition) if (!condition)
LogicError(logicErrorMessage); LogicError(logicErrorMessage);
@@ -437,9 +437,13 @@ featureToName(uint256 const& f)
uint256 const feature##name = registerFeature(#name, supported, vote); uint256 const feature##name = registerFeature(#name, supported, vote);
#define XRPL_FIX(name, supported, vote) \ #define XRPL_FIX(name, supported, vote) \
uint256 const fix##name = registerFeature("fix" #name, supported, vote); uint256 const fix##name = registerFeature("fix" #name, supported, vote);
#define XRPL_RETIRE(name) \
[[deprecated("The referenced amendment has been retired"), maybe_unused]] \ // clang-format off
#define XRPL_RETIRE(name) \
[[deprecated("The referenced amendment has been retired")]] \
[[maybe_unused]] \
uint256 const retired##name = retireFeature(#name); uint256 const retired##name = retireFeature(#name);
// clang-format on
#include <xrpl/protocol/detail/features.macro> #include <xrpl/protocol/detail/features.macro>
@@ -455,7 +459,7 @@ featureToName(uint256 const& f)
// //
// Use initialization of one final static variable to set // Use initialization of one final static variable to set
// featureCollections::readOnly. // featureCollections::readOnly.
[[maybe_unused]] static const bool readOnlySet = [[maybe_unused]] static bool const readOnlySet =
featureCollections.registrationIsDone(); featureCollections.registrationIsDone();
} // namespace ripple } // namespace ripple

View File

@@ -94,6 +94,7 @@ enum class LedgerNameSpace : std::uint16_t {
MPTOKEN = 't', MPTOKEN = 't',
CREDENTIAL = 'D', CREDENTIAL = 'D',
PERMISSIONED_DOMAIN = 'm', PERMISSIONED_DOMAIN = 'm',
DELEGATE = 'E',
VAULT = 'V', VAULT = 'V',
// No longer used or supported. Left here to reserve the space // No longer used or supported. Left here to reserve the space
@@ -453,6 +454,14 @@ amm(uint256 const& id) noexcept
return {ltAMM, id}; return {ltAMM, id};
} }
Keylet
delegate(AccountID const& account, AccountID const& authorizedAccount) noexcept
{
return {
ltDELEGATE,
indexHash(LedgerNameSpace::DELEGATE, account, authorizedAccount)};
}
Keylet Keylet
bridge(STXChainBridge const& bridge, STXChainBridge::ChainType chainType) bridge(STXChainBridge const& bridge, STXChainBridge::ChainType chainType)
{ {

View File

@@ -154,6 +154,10 @@ InnerObjectFormats::InnerObjectFormats()
{sfIssuer, soeREQUIRED}, {sfIssuer, soeREQUIRED},
{sfCredentialType, soeREQUIRED}, {sfCredentialType, soeREQUIRED},
}); });
add(sfPermission.jsonName.c_str(),
sfPermission.getCode(),
{{sfPermissionValue, soeREQUIRED}});
} }
InnerObjectFormats const& InnerObjectFormats const&

View File

@@ -29,7 +29,7 @@ namespace ripple {
LedgerFormats::LedgerFormats() LedgerFormats::LedgerFormats()
{ {
// Fields shared by all ledger formats: // Fields shared by all ledger formats:
static const std::initializer_list<SOElement> commonFields{ static std::initializer_list<SOElement> const commonFields{
{sfLedgerIndex, soeOPTIONAL}, {sfLedgerIndex, soeOPTIONAL},
{sfLedgerEntryType, soeREQUIRED}, {sfLedgerEntryType, soeREQUIRED},
{sfFlags, soeREQUIRED}, {sfFlags, soeREQUIRED},

View File

@@ -0,0 +1,148 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2025 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#include <xrpl/beast/utility/instrumentation.h>
#include <xrpl/protocol/Permissions.h>
#include <xrpl/protocol/jss.h>
namespace ripple {
Permission::Permission()
{
delegatableTx_ = {
#pragma push_macro("TRANSACTION")
#undef TRANSACTION
#define TRANSACTION(tag, value, name, delegatable, fields) {value, delegatable},
#include <xrpl/protocol/detail/transactions.macro>
#undef TRANSACTION
#pragma pop_macro("TRANSACTION")
};
granularPermissionMap_ = {
#pragma push_macro("PERMISSION")
#undef PERMISSION
#define PERMISSION(type, txType, value) {#type, type},
#include <xrpl/protocol/detail/permissions.macro>
#undef PERMISSION
#pragma pop_macro("PERMISSION")
};
granularNameMap_ = {
#pragma push_macro("PERMISSION")
#undef PERMISSION
#define PERMISSION(type, txType, value) {type, #type},
#include <xrpl/protocol/detail/permissions.macro>
#undef PERMISSION
#pragma pop_macro("PERMISSION")
};
granularTxTypeMap_ = {
#pragma push_macro("PERMISSION")
#undef PERMISSION
#define PERMISSION(type, txType, value) {type, txType},
#include <xrpl/protocol/detail/permissions.macro>
#undef PERMISSION
#pragma pop_macro("PERMISSION")
};
for ([[maybe_unused]] auto const& permission : granularPermissionMap_)
XRPL_ASSERT(
permission.second > UINT16_MAX,
"ripple::Permission::granularPermissionMap_ : granular permission "
"value must not exceed the maximum uint16_t value.");
}
Permission const&
Permission::getInstance()
{
static Permission const instance;
return instance;
}
std::optional<std::uint32_t>
Permission::getGranularValue(std::string const& name) const
{
auto const it = granularPermissionMap_.find(name);
if (it != granularPermissionMap_.end())
return static_cast<uint32_t>(it->second);
return std::nullopt;
}
std::optional<std::string>
Permission::getGranularName(GranularPermissionType const& value) const
{
auto const it = granularNameMap_.find(value);
if (it != granularNameMap_.end())
return it->second;
return std::nullopt;
}
std::optional<TxType>
Permission::getGranularTxType(GranularPermissionType const& gpType) const
{
auto const it = granularTxTypeMap_.find(gpType);
if (it != granularTxTypeMap_.end())
return it->second;
return std::nullopt;
}
bool
Permission::isDelegatable(std::uint32_t const& permissionValue) const
{
auto const granularPermission =
getGranularName(static_cast<GranularPermissionType>(permissionValue));
if (granularPermission)
// granular permissions are always allowed to be delegated
return true;
auto const it = delegatableTx_.find(permissionValue - 1);
if (it != delegatableTx_.end() && it->second == Delegation::notDelegatable)
return false;
return true;
}
uint32_t
Permission::txToPermissionType(TxType const& type) const
{
return static_cast<uint32_t>(type) + 1;
}
TxType
Permission::permissionToTxType(uint32_t const& value) const
{
return static_cast<TxType>(value - 1);
}
} // namespace ripple

View File

@@ -183,7 +183,7 @@ Quality
Quality::round(int digits) const Quality::round(int digits) const
{ {
// Modulus for mantissa // Modulus for mantissa
static const std::uint64_t mod[17] = { static std::uint64_t const mod[17] = {
/* 0 */ 10000000000000000, /* 0 */ 10000000000000000,
/* 1 */ 1000000000000000, /* 1 */ 1000000000000000,
/* 2 */ 100000000000000, /* 2 */ 100000000000000,

View File

@@ -87,7 +87,7 @@ SField::SField(
private_access_tag_t, private_access_tag_t,
SerializedTypeID tid, SerializedTypeID tid,
int fv, int fv,
const char* fn, char const* fn,
int meta, int meta,
IsSigning signing) IsSigning signing)
: fieldCode(field_code(tid, fv)) : fieldCode(field_code(tid, fv))

View File

@@ -106,7 +106,7 @@ STAccount::add(Serializer& s) const
} }
bool bool
STAccount::isEquivalent(const STBase& t) const STAccount::isEquivalent(STBase const& t) const
{ {
auto const* const tPtr = dynamic_cast<STAccount const*>(&t); auto const* const tPtr = dynamic_cast<STAccount const*>(&t);
return tPtr && (default_ == tPtr->default_) && (value_ == tPtr->value_); return tPtr && (default_ == tPtr->default_) && (value_ == tPtr->value_);

View File

@@ -91,13 +91,13 @@ setSTAmountCanonicalizeSwitchover(bool v)
*getStaticSTAmountCanonicalizeSwitchover() = v; *getStaticSTAmountCanonicalizeSwitchover() = v;
} }
static const std::uint64_t tenTo14 = 100000000000000ull; static std::uint64_t const tenTo14 = 100000000000000ull;
static const std::uint64_t tenTo14m1 = tenTo14 - 1; static std::uint64_t const tenTo14m1 = tenTo14 - 1;
static const std::uint64_t tenTo17 = tenTo14 * 1000; static std::uint64_t const tenTo17 = tenTo14 * 1000;
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
static std::int64_t static std::int64_t
getInt64Value(STAmount const& amount, bool valid, const char* error) getInt64Value(STAmount const& amount, bool valid, char const* error)
{ {
if (!valid) if (!valid)
Throw<std::runtime_error>(error); Throw<std::runtime_error>(error);
@@ -683,9 +683,9 @@ STAmount::add(Serializer& s) const
} }
bool bool
STAmount::isEquivalent(const STBase& t) const STAmount::isEquivalent(STBase const& t) const
{ {
const STAmount* v = dynamic_cast<const STAmount*>(&t); STAmount const* v = dynamic_cast<STAmount const*>(&t);
return v && (*v == *this); return v && (*v == *this);
} }
@@ -1011,7 +1011,7 @@ amountFromJsonNoThrow(STAmount& result, Json::Value const& jvSource)
result = amountFromJson(sfGeneric, jvSource); result = amountFromJson(sfGeneric, jvSource);
return true; return true;
} }
catch (const std::exception& e) catch (std::exception const& e)
{ {
JLOG(debugLog().warn()) JLOG(debugLog().warn())
<< "amountFromJsonNoThrow: caught: " << e.what(); << "amountFromJsonNoThrow: caught: " << e.what();

View File

@@ -181,9 +181,9 @@ STArray::getSType() const
} }
bool bool
STArray::isEquivalent(const STBase& t) const STArray::isEquivalent(STBase const& t) const
{ {
auto v = dynamic_cast<const STArray*>(&t); auto v = dynamic_cast<STArray const*>(&t);
return v != nullptr && v_ == v->v_; return v != nullptr && v_ == v->v_;
} }
@@ -194,7 +194,7 @@ STArray::isDefault() const
} }
void void
STArray::sort(bool (*compare)(const STObject&, const STObject&)) STArray::sort(bool (*compare)(STObject const&, STObject const&))
{ {
std::sort(v_.begin(), v_.end(), compare); std::sort(v_.begin(), v_.end(), compare);
} }

View File

@@ -40,7 +40,7 @@ STBase::STBase(SField const& n) : fName(&n)
} }
STBase& STBase&
STBase::operator=(const STBase& t) STBase::operator=(STBase const& t)
{ {
if (!fName->isUseful()) if (!fName->isUseful())
fName = t.fName; fName = t.fName;
@@ -48,13 +48,13 @@ STBase::operator=(const STBase& t)
} }
bool bool
STBase::operator==(const STBase& t) const STBase::operator==(STBase const& t) const
{ {
return (getSType() == t.getSType()) && isEquivalent(t); return (getSType() == t.getSType()) && isEquivalent(t);
} }
bool bool
STBase::operator!=(const STBase& t) const STBase::operator!=(STBase const& t) const
{ {
return (getSType() != t.getSType()) || !isEquivalent(t); return (getSType() != t.getSType()) || !isEquivalent(t);
} }
@@ -116,7 +116,7 @@ STBase::add(Serializer& s) const
} }
bool bool
STBase::isEquivalent(const STBase& t) const STBase::isEquivalent(STBase const& t) const
{ {
XRPL_ASSERT( XRPL_ASSERT(
getSType() == STI_NOTPRESENT, getSType() == STI_NOTPRESENT,
@@ -154,7 +154,7 @@ STBase::addFieldID(Serializer& s) const
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
std::ostream& std::ostream&
operator<<(std::ostream& out, const STBase& t) operator<<(std::ostream& out, STBase const& t)
{ {
return out << t.getFullText(); return out << t.getFullText();
} }

View File

@@ -71,9 +71,9 @@ STBlob::add(Serializer& s) const
} }
bool bool
STBlob::isEquivalent(const STBase& t) const STBlob::isEquivalent(STBase const& t) const
{ {
const STBlob* v = dynamic_cast<const STBlob*>(&t); STBlob const* v = dynamic_cast<STBlob const*>(&t);
return v && (value_ == v->value_); return v && (value_ == v->value_);
} }

View File

@@ -72,9 +72,9 @@ STCurrency::add(Serializer& s) const
} }
bool bool
STCurrency::isEquivalent(const STBase& t) const STCurrency::isEquivalent(STBase const& t) const
{ {
const STCurrency* v = dynamic_cast<const STCurrency*>(&t); STCurrency const* v = dynamic_cast<STCurrency const*>(&t);
return v && (*v == *this); return v && (*v == *this);
} }

View File

@@ -22,6 +22,7 @@
#include <xrpl/beast/utility/instrumentation.h> #include <xrpl/beast/utility/instrumentation.h>
#include <xrpl/json/json_value.h> #include <xrpl/json/json_value.h>
#include <xrpl/protocol/LedgerFormats.h> #include <xrpl/protocol/LedgerFormats.h>
#include <xrpl/protocol/Permissions.h>
#include <xrpl/protocol/SField.h> #include <xrpl/protocol/SField.h>
#include <xrpl/protocol/STBase.h> #include <xrpl/protocol/STBase.h>
#include <xrpl/protocol/STInteger.h> #include <xrpl/protocol/STInteger.h>
@@ -177,6 +178,27 @@ template <>
Json::Value Json::Value
STUInt32::getJson(JsonOptions) const STUInt32::getJson(JsonOptions) const
{ {
if (getFName() == sfPermissionValue)
{
auto const permissionValue =
static_cast<GranularPermissionType>(value_);
auto const granular =
Permission::getInstance().getGranularName(permissionValue);
if (granular)
{
return *granular;
}
else
{
auto const txType =
Permission::getInstance().permissionToTxType(value_);
auto item = TxFormats::getInstance().findByType(txType);
if (item != nullptr)
return item->getName();
}
}
return value_; return value_;
} }

View File

@@ -128,9 +128,9 @@ STIssue::add(Serializer& s) const
} }
bool bool
STIssue::isEquivalent(const STBase& t) const STIssue::isEquivalent(STBase const& t) const
{ {
const STIssue* v = dynamic_cast<const STIssue*>(&t); STIssue const* v = dynamic_cast<STIssue const*>(&t);
return v && (*v == *this); return v && (*v == *this);
} }

View File

@@ -31,7 +31,6 @@
#include <xrpl/protocol/SField.h> #include <xrpl/protocol/SField.h>
#include <xrpl/protocol/STBase.h> #include <xrpl/protocol/STBase.h>
#include <xrpl/protocol/STLedgerEntry.h> #include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STNumber.h>
#include <xrpl/protocol/STObject.h> #include <xrpl/protocol/STObject.h>
#include <xrpl/protocol/Serializer.h> #include <xrpl/protocol/Serializer.h>
#include <xrpl/protocol/jss.h> #include <xrpl/protocol/jss.h>

View File

@@ -25,6 +25,7 @@
#include <xrpl/protocol/STNumber.h> #include <xrpl/protocol/STNumber.h>
#include <xrpl/protocol/Serializer.h> #include <xrpl/protocol/Serializer.h>
#include <boost/lexical_cast.hpp>
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <cstddef> #include <cstddef>
@@ -152,14 +153,13 @@ partsFromString(std::string const& number)
if (!match[4].matched) // integer only if (!match[4].matched) // integer only
{ {
mantissa = mantissa = boost::lexical_cast<std::uint64_t>(std::string(match[2]));
beast::lexicalCastThrow<std::uint64_t>(std::string(match[2]));
exponent = 0; exponent = 0;
} }
else else
{ {
// integer and fraction // integer and fraction
mantissa = beast::lexicalCastThrow<std::uint64_t>(match[2] + match[4]); mantissa = boost::lexical_cast<std::uint64_t>(match[2] + match[4]);
exponent = -(match[4].length()); exponent = -(match[4].length());
} }
@@ -167,9 +167,9 @@ partsFromString(std::string const& number)
{ {
// we have an exponent // we have an exponent
if (match[6].matched && (match[6] == "-")) if (match[6].matched && (match[6] == "-"))
exponent -= beast::lexicalCastThrow<int>(std::string(match[7])); exponent -= boost::lexical_cast<int>(std::string(match[7]));
else else
exponent += beast::lexicalCastThrow<int>(std::string(match[7])); exponent += boost::lexical_cast<int>(std::string(match[7]));
} }
return {mantissa, exponent, negative}; return {mantissa, exponent, negative};

View File

@@ -153,7 +153,7 @@ STObject::operator=(STObject&& other)
} }
void void
STObject::set(const SOTemplate& type) STObject::set(SOTemplate const& type)
{ {
v_.clear(); v_.clear();
v_.reserve(type.size()); v_.reserve(type.size());
@@ -169,7 +169,7 @@ STObject::set(const SOTemplate& type)
} }
void void
STObject::applyTemplate(const SOTemplate& type) STObject::applyTemplate(SOTemplate const& type)
{ {
auto throwFieldErr = [](std::string const& field, char const* description) { auto throwFieldErr = [](std::string const& field, char const* description) {
std::stringstream ss; std::stringstream ss;
@@ -296,9 +296,9 @@ STObject::set(SerialIter& sit, int depth)
} }
bool bool
STObject::hasMatchingEntry(const STBase& t) STObject::hasMatchingEntry(STBase const& t)
{ {
const STBase* o = peekAtPField(t.getFName()); STBase const* o = peekAtPField(t.getFName());
if (!o) if (!o)
return false; return false;
@@ -357,9 +357,9 @@ STObject::getText() const
} }
bool bool
STObject::isEquivalent(const STBase& t) const STObject::isEquivalent(STBase const& t) const
{ {
const STObject* v = dynamic_cast<const STObject*>(&t); STObject const* v = dynamic_cast<STObject const*>(&t);
if (!v) if (!v)
return false; return false;
@@ -425,7 +425,7 @@ STObject::getFieldIndex(SField const& field) const
return -1; return -1;
} }
const STBase& STBase const&
STObject::peekAtField(SField const& field) const STObject::peekAtField(SField const& field) const
{ {
int index = getFieldIndex(field); int index = getFieldIndex(field);
@@ -453,7 +453,7 @@ STObject::getFieldSType(int index) const
return v_[index]->getFName(); return v_[index]->getFName();
} }
const STBase* STBase const*
STObject::peekAtPField(SField const& field) const STObject::peekAtPField(SField const& field) const
{ {
int index = getFieldIndex(field); int index = getFieldIndex(field);
@@ -536,7 +536,7 @@ STObject::isFlag(std::uint32_t f) const
std::uint32_t std::uint32_t
STObject::getFlags(void) const STObject::getFlags(void) const
{ {
const STUInt32* t = dynamic_cast<const STUInt32*>(peekAtPField(sfFlags)); STUInt32 const* t = dynamic_cast<STUInt32 const*>(peekAtPField(sfFlags));
if (!t) if (!t)
return 0; return 0;
@@ -574,7 +574,7 @@ STObject::makeFieldAbsent(SField const& field)
if (index == -1) if (index == -1)
throwFieldNotFound(field); throwFieldNotFound(field);
const STBase& f = peekAtIndex(index); STBase const& f = peekAtIndex(index);
if (f.getSType() == STI_NOTPRESENT) if (f.getSType() == STI_NOTPRESENT)
return; return;
@@ -675,14 +675,14 @@ STObject::getFieldPathSet(SField const& field) const
return getFieldByConstRef<STPathSet>(field, empty); return getFieldByConstRef<STPathSet>(field, empty);
} }
const STVector256& STVector256 const&
STObject::getFieldV256(SField const& field) const STObject::getFieldV256(SField const& field) const
{ {
static STVector256 const empty{}; static STVector256 const empty{};
return getFieldByConstRef<STVector256>(field, empty); return getFieldByConstRef<STVector256>(field, empty);
} }
const STArray& STArray const&
STObject::getFieldArray(SField const& field) const STObject::getFieldArray(SField const& field) const
{ {
static STArray const empty{}; static STArray const empty{};
@@ -835,7 +835,7 @@ STObject::getJson(JsonOptions options) const
} }
bool bool
STObject::operator==(const STObject& obj) const STObject::operator==(STObject const& obj) const
{ {
// This is not particularly efficient, and only compares data elements // This is not particularly efficient, and only compares data elements
// with binary representations // with binary representations

View File

@@ -27,6 +27,7 @@
#include <xrpl/protocol/AccountID.h> #include <xrpl/protocol/AccountID.h>
#include <xrpl/protocol/ErrorCodes.h> #include <xrpl/protocol/ErrorCodes.h>
#include <xrpl/protocol/LedgerFormats.h> #include <xrpl/protocol/LedgerFormats.h>
#include <xrpl/protocol/Permissions.h>
#include <xrpl/protocol/SField.h> #include <xrpl/protocol/SField.h>
#include <xrpl/protocol/STAccount.h> #include <xrpl/protocol/STAccount.h>
#include <xrpl/protocol/STAmount.h> #include <xrpl/protocol/STAmount.h>
@@ -374,10 +375,35 @@ parseLeaf(
{ {
if (value.isString()) if (value.isString())
{ {
ret = detail::make_stvar<STUInt32>( if (field == sfPermissionValue)
field, {
beast::lexicalCastThrow<std::uint32_t>( std::string const strValue = value.asString();
value.asString())); auto const granularPermission =
Permission::getInstance().getGranularValue(
strValue);
if (granularPermission)
{
ret = detail::make_stvar<STUInt32>(
field, *granularPermission);
}
else
{
auto const& txType =
TxFormats::getInstance().findTypeByName(
strValue);
ret = detail::make_stvar<STUInt32>(
field,
Permission::getInstance().txToPermissionType(
txType));
}
}
else
{
ret = detail::make_stvar<STUInt32>(
field,
beast::lexicalCastThrow<std::uint32_t>(
value.asString()));
}
} }
else if (value.isInt()) else if (value.isInt())
{ {
@@ -840,7 +866,7 @@ parseLeaf(
return ret; return ret;
} }
static const int maxDepth = 64; static int const maxDepth = 64;
// Forward declaration since parseObject() and parseArray() call each other. // Forward declaration since parseObject() and parseArray() call each other.
static std::optional<detail::STVar> static std::optional<detail::STVar>
@@ -1026,7 +1052,8 @@ parseArray(
Json::Value const objectFields(json[i][objectName]); Json::Value const objectFields(json[i][objectName]);
std::stringstream ss; std::stringstream ss;
ss << json_name << "." << "[" << i << "]." << objectName; ss << json_name << "."
<< "[" << i << "]." << objectName;
auto ret = parseObject( auto ret = parseObject(
ss.str(), objectFields, nameField, depth + 1, error); ss.str(), objectFields, nameField, depth + 1, error);

View File

@@ -145,9 +145,9 @@ STPathSet::assembleAdd(STPath const& base, STPathElement const& tail)
} }
bool bool
STPathSet::isEquivalent(const STBase& t) const STPathSet::isEquivalent(STBase const& t) const
{ {
const STPathSet* v = dynamic_cast<const STPathSet*>(&t); STPathSet const* v = dynamic_cast<STPathSet const*>(&t);
return v && (value == v->value); return v && (value == v->value);
} }

View File

@@ -86,9 +86,9 @@ STVector256::add(Serializer& s) const
} }
bool bool
STVector256::isEquivalent(const STBase& t) const STVector256::isEquivalent(STBase const& t) const
{ {
const STVector256* v = dynamic_cast<const STVector256*>(&t); STVector256 const* v = dynamic_cast<STVector256 const*>(&t);
return v && (mValue == v->mValue); return v && (mValue == v->mValue);
} }

View File

@@ -197,9 +197,9 @@ STXChainBridge::getSType() const
} }
bool bool
STXChainBridge::isEquivalent(const STBase& t) const STXChainBridge::isEquivalent(STBase const& t) const
{ {
const STXChainBridge* v = dynamic_cast<const STXChainBridge*>(&t); STXChainBridge const* v = dynamic_cast<STXChainBridge const*>(&t);
return v && (*v == *this); return v && (*v == *this);
} }

Some files were not shown because too many files have changed in this diff Show More