Skip to content

Commit 35e9134

Browse files
Support for Lending Protocol (XLS-66d) (#866)
* Models and unit tests for LP amendment; * fix: add PermissionDelegationV1_1 amendment into the config file for explicit inclusion --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 786db5e commit 35e9134

File tree

26 files changed

+2354
-7
lines changed

26 files changed

+2354
-7
lines changed

.ci-config/rippled.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,11 @@ PermissionedDomains
201201
SingleAssetVault
202202
fixFrozenLPTokenTransfer
203203
fixInvalidTxFlags
204-
PermissionDelegationV1_1
205204
PermissionedDEX
206205
Batch
207206
TokenEscrow
207+
LendingProtocol
208+
PermissionDelegationV1_1
208209

209210
# This section can be used to simulate various FeeSettings scenarios for rippled node in standalone mode
210211
[voting]

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [[Unreleased]]
99

10+
### Added
11+
- Support for the Lending Protocol (XLS-66d)
12+
1013
## [[4.3.1]] - 2025-11-12
1114

1215
### Added
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
from tests.integration.integration_test_case import IntegrationTestCase
2+
from tests.integration.it_utils import fund_wallet_async, test_async_and_sync
3+
from xrpl.asyncio.transaction import autofill_and_sign
4+
from xrpl.models.requests import Sign
5+
from xrpl.models.transactions import LoanSet
6+
from xrpl.wallet import Wallet
7+
8+
_SECRET = "randomsecretkey"
9+
_LOAN_BROKER_ID = "D1B9DFF432B4F56127BE947281A327B656F202FC1530DD6409D771F7C4CA4F4B"
10+
_COUNTERPARTY_ADDRESS = "rnFRDVZUV9GmqoUJ65gkaQnMEiAnCdxb2m"
11+
12+
13+
class TestSign(IntegrationTestCase):
14+
@test_async_and_sync(globals(), ["xrpl.transaction.autofill_and_sign"])
15+
async def test_basic_functionality(self, client):
16+
loan_issuer = Wallet.create()
17+
await fund_wallet_async(loan_issuer)
18+
19+
loan_issuer_signed_txn = await autofill_and_sign(
20+
LoanSet(
21+
account=loan_issuer.address,
22+
loan_broker_id=_LOAN_BROKER_ID,
23+
principal_requested="100",
24+
counterparty=_COUNTERPARTY_ADDRESS,
25+
),
26+
client,
27+
loan_issuer,
28+
)
29+
response = await client.request(
30+
Sign(
31+
transaction=loan_issuer_signed_txn,
32+
signature_target="CounterpartySignature",
33+
secret=_SECRET,
34+
)
35+
)
36+
self.assertTrue(response.is_successful())
37+
self.assertTrue(response.result["tx_json"]["CounterpartySignature"] is not None)
38+
self.assertTrue(
39+
response.result["tx_json"]["CounterpartySignature"]["SigningPubKey"]
40+
is not None
41+
)
42+
self.assertTrue(
43+
response.result["tx_json"]["CounterpartySignature"]["TxnSignature"]
44+
is not None
45+
)

0 commit comments

Comments
 (0)