Skip to content

Commit 12799f9

Browse files
authored
Merge branch 'main' into feat/xls-65-single-asset-vault
2 parents e7862ed + f01a94c commit 12799f9

146 files changed

Lines changed: 4509 additions & 496 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ small
4343

4444
[node_db]
4545
type=NuDB
46-
path=/var/lib/rippled/db/nudb
46+
path=/var/lib/xrpld/db/nudb
4747
advisory_delete=0
4848

4949
# How many ledgers do we want to keep (history)?
@@ -58,10 +58,10 @@ online_delete=256
5858
256
5959

6060
[database_path]
61-
/var/lib/rippled/db
61+
/var/lib/xrpld/db
6262

6363
[debug_logfile]
64-
/var/log/rippled/debug.log
64+
/var/log/xrpld/debug.log
6565

6666
[network_id]
6767
0

.github/workflows/build_and_lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
push:
33
branches:
4-
- dev
4+
- main
55
pull_request:
66
branches:
77
- main

.github/workflows/integration_test.yml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ on:
22
push:
33
branches:
44
- main
5-
- dev
65
pull_request:
76
branches:
87
- main
@@ -11,8 +10,14 @@ on:
1110
name: Integration Test
1211

1312
env:
13+
<<<<<<< feat/xls-65-single-asset-vault
1414
# Pin to known-good digest; rippleci/rippled:develop broke after 2026-04-01
1515
RIPPLED_DOCKER_IMAGE: rippleci/rippled:develop@sha256:328175bf14b7b83db9e5e6b50c7458bf828b02b2855453efc038233094aa8d85
16+
=======
17+
# rippled binary was renamed to xrpld; use the new image name.
18+
# Tracks xrpl.js PR #3270 (https://github.com/XRPLF/xrpl.js/pull/3270).
19+
XRPLD_DOCKER_IMAGE: rippleci/xrpld:develop
20+
>>>>>>> main
1621

1722
jobs:
1823
integration_test:
@@ -23,25 +28,9 @@ jobs:
2328
steps:
2429
- uses: actions/checkout@v4
2530

26-
- name: Start rippled standalone
27-
run: |
28-
docker run --detach --rm \
29-
-p 5005:5005 \
30-
-p 6006:6006 \
31-
--volume "${{ github.workspace }}/.ci-config/":"/etc/opt/ripple/" \
32-
--name rippled-service \
33-
--health-cmd="rippled server_info || exit 1" \
34-
--health-interval=5s \
35-
--health-retries=10 \
36-
--health-timeout=2s \
37-
--env GITHUB_ACTIONS=true \
38-
--env CI=true \
39-
--entrypoint bash \
40-
${{ env.RIPPLED_DOCKER_IMAGE }} \
41-
-c "mkdir -p /var/lib/rippled/db/ && rippled -a"
42-
43-
- name: Wait for rippled to be healthy
31+
- name: Run xrpld in standalone mode
4432
run: |
33+
<<<<<<< feat/xls-65-single-asset-vault
4534
for i in $(seq 1 30); do
4635
if ! docker ps -q -f name=rippled-service | grep -q .; then
4736
echo "Container exited unexpectedly"
@@ -58,6 +47,16 @@ jobs:
5847
echo "Timed out waiting for rippled"
5948
docker logs rippled-service 2>&1 || true
6049
exit 1
50+
=======
51+
docker run \
52+
--detach \
53+
--rm \
54+
--publish 5005:5005 \
55+
--publish 6006:6006 \
56+
--volume "${{ github.workspace }}/.ci-config/":"/etc/xrpld/" \
57+
--name xrpld-service \
58+
${{ env.XRPLD_DOCKER_IMAGE }} --standalone
59+
>>>>>>> main
6160

6261
- uses: dtolnay/rust-toolchain@stable
6362

@@ -77,6 +76,8 @@ jobs:
7776
env:
7877
RUST_BACKTRACE: 1
7978

80-
- name: Stop rippled
79+
- name: Dump xrpld logs and stop container
8180
if: always()
82-
run: docker stop rippled-service
81+
run: |
82+
docker logs xrpld-service 2>&1 || echo "::warning::xrpld-service container not present for logs"
83+
docker stop xrpld-service 2>/dev/null || true

.github/workflows/quality_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
on:
22
push:
33
branches:
4-
- dev
4+
- main
55
pull_request:
66
branches:
77
- main
88
- dev
99
schedule:
10-
- cron: '0 0 * * *'
10+
- cron: "0 0 * * *"
1111

1212
name: Quality Check
1313

.github/workflows/unit_test.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
push:
33
branches:
4-
- dev
4+
- main
55
pull_request:
66
branches:
77
- main
@@ -34,22 +34,44 @@ jobs:
3434
RUST_BACKTRACE: 1
3535

3636
- name: Test for no_std
37-
run: cargo test --release --no-default-features --features embassy-rt,core,utils,wallet,models,helpers,websocket,json-rpc
37+
run: cargo test --release --no-default-features --features
38+
embassy-rt,core,utils,wallet,models,helpers,websocket,json-rpc
3839
env:
3940
RUST_BACKTRACE: 1
4041

4142
- name: Install cargo-llvm-cov
4243
uses: taiki-e/install-action@cargo-llvm-cov
4344

45+
# Unit-test coverage is scoped via Cargo features rather than path
46+
# exclusion. The minimal feature set (`std,core,utils,wallet,models`)
47+
# compiles only the pure-logic modules — pure crypto, codec, address
48+
# codec, transaction models, and the `signing` module. Integration-
49+
# territory code (CLI, async network clients, sync wrappers around
50+
# network calls, faucet client) is gated behind `helpers`/`json-rpc`/
51+
# `websocket`/`cli` features, so it simply isn't compiled here and
52+
# doesn't appear in the coverage report. Those files are exercised by
53+
# the integration-test workflow against a live rippled.
4454
- name: Generate coverage report
45-
run: cargo llvm-cov --lcov --output-path lcov.info
55+
run: |
56+
cargo llvm-cov \
57+
--no-default-features --features std,core,utils,wallet,models \
58+
--lcov --output-path lcov.info
4659
4760
- name: Check coverage thresholds
4861
run: |
4962
cargo llvm-cov --summary-only \
50-
--fail-under-lines 73 \
51-
--fail-under-regions 75 \
52-
--fail-under-functions 67
63+
--no-default-features --features std,core,utils,wallet,models \
64+
--fail-under-lines 83 \
65+
--fail-under-regions 85 \
66+
--fail-under-functions 73
67+
68+
- name: Upload coverage to Codecov
69+
uses: codecov/codecov-action@v5
70+
with:
71+
token: ${{ secrets.CODECOV_TOKEN }}
72+
files: lcov.info
73+
flags: unit
74+
fail_ci_if_error: true
5375

5476
- name: Upload coverage report
5577
uses: actions/upload-artifact@v4

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414

1515
### Added
1616

17+
- New `xrpl::signing` module containing the pure-crypto signing helpers (`sign`, `multisign`, `prepare_transaction`) extracted from `asynch::transaction` and `transaction`. Available with just `core + models + wallet` features (no `helpers`/runtime/client dependency). The legacy paths `asynch::transaction::sign` and `transaction::multisign` are preserved as re-exports for backward compatibility.
18+
- Expanded unit-test coverage and raised CI thresholds: lines `73 → 83`, regions `75 → 85`, functions `67 → 73`.
19+
- Codecov integration with per-PR project (≥83%) and patch (≥80% on new/modified lines) gates.
20+
21+
### Changed
22+
23+
- Unit-test and integration-test coverage are now scoped via Cargo feature flags rather than path regex. The unit-test workflow builds with `--no-default-features --features std,core,utils,wallet,models`, so integration-territory code (CLI, async clients, sync wrappers, faucet) simply isn't compiled and doesn't appear in the unit coverage report.
24+
- Network-dependent inline tests in `src/asynch/transaction/` and `src/asynch/wallet/` (`test_autofill_txn`, `test_autofill_and_sign`, `test_submit_and_wait`, `test_generate_faucet_wallet`) are now gated behind `feature = "integration"` so `cargo test --release` is hermetic by default.
25+
1726
### Fixed
1827

28+
- `RipplePathFind::destination_amount` changed from `Currency<'a>` to `Amount<'a>` to match the XRPL wire format.
29+
- `NoRippleCheckRole` no longer serializes with the `#[serde(tag = "role")]` discriminator; now emits a plain `snake_case` string matching the XRPL wire format.
30+
1931
## [[v1.1.0]]
2032

2133
### Added

CONTRIBUTING.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ cargo clippy
5454
5555
### Running Tests
5656

57-
For integration tests, we use a `rippled` node in standalone mode to test xrpl-rust code against. To set this up, you can either configure and run `rippled` locally, or set up the Docker container `rippleci/rippled` by [following these instructions](#integration-tests). The latter will require you to [install Docker](https://docs.docker.com/get-docker/).
57+
For integration tests, we use an `xrpld` node in standalone mode to test xrpl-rust code against. To set this up, you can either configure and run `xrpld` locally, or set up the Docker container `rippleci/xrpld` by [following these instructions](#integration-tests). The latter will require you to [install Docker](https://docs.docker.com/get-docker/).
5858

5959
#### Unit Tests
6060

@@ -72,10 +72,10 @@ cargo test --release --no-default-features --features embassy-rt,core,utils,wall
7272
From the `xrpl-rust` folder, run the following commands:
7373

7474
```bash
75-
# Sets up the rippled standalone Docker container — skip if you already have it running
76-
docker run -p 5005:5005 -p 6006:6006 --rm -it --name rippled_standalone \
77-
--entrypoint bash rippleci/rippled:develop \
78-
-c 'mkdir -p /var/lib/rippled/db/ && rippled -a'
75+
# Sets up the xrpld standalone Docker container — skip if you already have it running
76+
docker run -p 5005:5005 -p 6006:6006 --rm -it --name xrpld_standalone \
77+
--volume "$PWD/.ci-config/:/etc/xrpld/" \
78+
rippleci/xrpld:develop --standalone
7979
cargo test --release --features integration,std,json-rpc,helpers
8080
```
8181

@@ -90,11 +90,10 @@ Breaking down the `docker run` command:
9090
- `-p 5005:5005 -p 6006:6006` exposes the HTTP JSON-RPC and WebSocket admin ports.
9191
- `--rm` closes the container automatically when it exits.
9292
- `-it` keeps stdin open so you can stop the node with Ctrl-C.
93-
- `--name rippled_standalone` is an instance name for clarity.
94-
- `--volume $PWD/.ci-config:/etc/opt/ripple/` mounts `rippled.cfg` so the node binds on `0.0.0.0` and is reachable from the host. It must be an absolute path, so we use `$PWD` instead of `./`.
95-
- `rippleci/rippled` is an image that is regularly updated with the latest `rippled` releases.
96-
- `--entrypoint bash rippleci/rippled:develop` manually overrides the entrypoint (for the latest version of rippled on the `develop` branch).
97-
- `-c 'mkdir -p /var/lib/rippled/db/ && rippled -a'` starts `rippled` in standalone mode, where ledgers only close on demand.
93+
- `--name xrpld_standalone` is an instance name for clarity.
94+
- `--volume $PWD/.ci-config/:/etc/xrpld/`: bind-mounts the host directory (left side) into the container (right side). `xrpld.cfg` lives in `$PWD/.ci-config/`, and this command is intended to be run from the root of the `xrpl-rust` project. The `xrpld` binary searches for its configuration file inside `/etc/xrpld/`. An absolute path is required, so we use `$PWD` instead of `./`.
95+
- `rippleci/xrpld` is an image that is regularly updated with the latest `xrpld` releases (the binary formerly known as `rippled`; see xrpl.js PR #3270).
96+
- `--standalone` starts `xrpld` in standalone mode, where ledgers only close on demand.
9897

9998
**Notes**
10099

@@ -115,7 +114,7 @@ cargo llvm-cov --summary-only
115114
The CI enforces the following minimum thresholds (current baseline is ~78% lines / ~68% regions / ~75% functions, measured with default features only — integration tests are excluded from coverage):
116115

117116
| Metric | Minimum |
118-
|-----------|---------|
117+
| --------- | ------- |
119118
| Lines | 75% |
120119
| Regions | 65% |
121120
| Functions | 72% |

codecov.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: 83%
6+
threshold: 1%
7+
flags:
8+
- unit
9+
patch:
10+
default:
11+
target: 80%
12+
threshold: 1%
13+
14+
comment:
15+
layout: "reach, diff, flags, files"
16+
require_changes: false
17+
18+
flags:
19+
unit:
20+
paths:
21+
- src/

docker-compose.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
version: "3"
22

33
services:
4-
rippled:
5-
image: rippleci/rippled:develop
4+
xrpld:
5+
image: rippleci/xrpld:develop
66
volumes:
7-
- ./.ci-config:/etc/opt/ripple
7+
- ./.ci-config:/etc/xrpld
88
ports:
99
- "5005:5005"
1010
- "6006:6006"
11-
entrypoint: bash
12-
command: -c "mkdir -p /var/lib/rippled/db/ && rippled -a"
11+
command: ["--standalone"]
1312
healthcheck:
14-
test: ["CMD", "rippled", "server_info"]
13+
test: ["CMD", "xrpld", "server_info"]
1514
interval: 5s
1615
timeout: 2s
1716
retries: 10

src/asynch/exceptions.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,27 @@ use thiserror_no_std::Error;
44
use super::clients::exceptions::XRPLClientException;
55
#[cfg(feature = "helpers")]
66
use super::{
7-
transaction::exceptions::{
8-
XRPLSignTransactionException, XRPLSubmitAndWaitException, XRPLTransactionHelperException,
9-
},
7+
transaction::exceptions::{XRPLSubmitAndWaitException, XRPLTransactionHelperException},
108
wallet::exceptions::XRPLFaucetException,
119
};
12-
#[cfg(feature = "helpers")]
10+
#[cfg(feature = "wallet")]
11+
use crate::wallet::exceptions::XRPLWalletException;
12+
// Available whenever `signing` is compiled (which requires core+models+wallet),
13+
// or whenever `helpers` is on — the former is a subset of the latter.
14+
#[cfg(all(feature = "core", feature = "models", feature = "wallet"))]
1315
use crate::{
1416
core::exceptions::XRPLCoreException,
1517
models::transactions::exceptions::XRPLTransactionFieldException,
16-
transaction::exceptions::XRPLMultisignException, utils::exceptions::XRPLUtilsException,
17-
wallet::exceptions::XRPLWalletException,
18+
signing::exceptions::{XRPLMultisignException, XRPLSignTransactionException},
19+
utils::exceptions::XRPLUtilsException,
1820
};
1921
use crate::{models::XRPLModelException, XRPLSerdeJsonError};
2022

2123
pub type XRPLHelperResult<T, E = XRPLHelperException> = core::result::Result<T, E>;
2224

2325
#[derive(Debug, Error)]
2426
pub enum XRPLHelperException {
25-
#[cfg(feature = "helpers")]
27+
#[cfg(feature = "wallet")]
2628
#[error("XRPL Wallet error: {0}")]
2729
XRPLWalletError(#[from] XRPLWalletException),
2830
#[cfg(feature = "helpers")]
@@ -33,18 +35,21 @@ pub enum XRPLHelperException {
3335
XRPLTransactionHelperError(#[from] XRPLTransactionHelperException),
3436
#[error("XRPL Model error: {0}")]
3537
XRPLModelError(#[from] XRPLModelException),
36-
#[cfg(feature = "helpers")]
38+
#[cfg(all(feature = "core", feature = "models", feature = "wallet"))]
3739
#[error("XRPL Core error: {0}")]
3840
XRPLCoreError(#[from] XRPLCoreException),
39-
#[cfg(feature = "helpers")]
41+
#[cfg(all(feature = "core", feature = "models", feature = "wallet"))]
4042
#[error("XRPL Transaction Field error: {0}")]
4143
XRPLTransactionFieldError(#[from] XRPLTransactionFieldException),
42-
#[cfg(feature = "helpers")]
44+
#[cfg(all(feature = "core", feature = "models", feature = "wallet"))]
4345
#[error("XRPL Utils error: {0}")]
4446
XRPLUtilsError(#[from] XRPLUtilsException),
45-
#[cfg(feature = "helpers")]
47+
#[cfg(all(feature = "core", feature = "models", feature = "wallet"))]
4648
#[error("XRPL MultiSign error: {0}")]
4749
XRPLMultiSignError(#[from] XRPLMultisignException),
50+
#[cfg(all(feature = "core", feature = "models", feature = "wallet"))]
51+
#[error("XRPL Sign Transaction error: {0}")]
52+
XRPLSignTransactionError(#[from] XRPLSignTransactionException),
4853
#[cfg(any(feature = "json-rpc", feature = "websocket"))]
4954
#[error("XRPL Client error: {0}")]
5055
XRPLClientError(#[from] XRPLClientException),
@@ -63,14 +68,9 @@ impl From<serde_json::Error> for XRPLHelperException {
6368
}
6469
}
6570

66-
#[cfg(feature = "helpers")]
67-
impl From<XRPLSignTransactionException> for XRPLHelperException {
68-
fn from(error: XRPLSignTransactionException) -> Self {
69-
XRPLHelperException::XRPLTransactionHelperError(
70-
XRPLTransactionHelperException::XRPLSignTransactionError(error),
71-
)
72-
}
73-
}
71+
// `XRPLSignTransactionException` is now a direct variant of
72+
// `XRPLHelperException` (see `XRPLSignTransactionError`), so the `From` impl
73+
// is derived automatically.
7474

7575
#[cfg(feature = "helpers")]
7676
impl From<XRPLSubmitAndWaitException> for XRPLHelperException {

0 commit comments

Comments
 (0)