-
Notifications
You must be signed in to change notification settings - Fork 116
Support for Lending Protocol (XLS-66d) #866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
373fb52
Models and unit tests for LP amendment; TODO: Integ tests are remaini…
ckeshava aadadbe
update integration test with LoanSet transaction
ckeshava 1db1744
add integ tests for loan-crud operations; update changelog
ckeshava b062bc3
address first batch of coderabbit AI suggestions
ckeshava faca6ae
Merge branch 'main' into xls66d
ckeshava 9083a84
fix linter errors
ckeshava c672015
update Number internal rippled type into str JSON type
ckeshava 029d65c
add unit tests and validation for loan_broker_set txn
ckeshava 1ddf348
loan_set validation and unit tests
ckeshava 4e5cf35
add hex validation for data field
ckeshava 388553d
update tests for LoanSet txn; remove start_date field
ckeshava 31b699e
integ test for Lending Protocol with IOU
ckeshava e39509f
fix the errors in STIssue codec
ckeshava 88eade6
Merge branch 'updateIssueCodec' into xls66d
ckeshava 3b47b6f
remove debug helper method
ckeshava 9c38b73
integ test for VaultCreate txn with MPToken
ckeshava f6daf47
feature: allow xrpl-py integ tests to run on XRPL Devnet; This commit…
ckeshava 9f27a07
fix: update the order of the encoding arguments in serialization of I…
ckeshava d47410a
add SAV integ test with MPToken as Vault asset
ckeshava bd2f13a
fix: big-endian format to interpret the sequence number in MPTID
ckeshava fc158fb
Update tests/integration/it_utils.py
ckeshava 2183f0a
address code rabbit suggestions
ckeshava 3162f69
Merge branch 'updateIssueCodec' into xls66d
ckeshava 48bd4e7
integ test: LendingProtocol Vault with MPToken asset
ckeshava 98288b8
Merge branch 'main' into xls66d
ckeshava 9f537b1
Merge branch 'main' into xls66d
ckeshava 394940a
Merge remote-tracking branch 'origin' into xls66d
ckeshava 59b543b
update: PermissionDelegation and LP features have been updated to Sup…
ckeshava d567c60
Merge branch 'xls66d' of https://github.com/ckeshava/xrpl-py into xls66d
ckeshava 2ba7a5a
feat: Update the design of autofill transaction-fees for the LoanSet …
ckeshava 53bb44c
feat: update autofill method to handle the case where LoanBroker owne…
ckeshava adc5929
address minor coderabbit suggestions
ckeshava ffb6608
feat: add support and tests for sign method
ckeshava 9188107
fix: remove moot case in autofilling fees for LoanSet transaction
ckeshava bc27377
fix: add PermissionDelegationV1_1 amendment into the config file for …
ckeshava File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| from tests.integration.integration_test_case import IntegrationTestCase | ||
| from tests.integration.it_utils import fund_wallet_async, test_async_and_sync | ||
| from xrpl.asyncio.transaction import autofill_and_sign | ||
| from xrpl.models.requests import Sign | ||
| from xrpl.models.transactions import LoanSet | ||
| from xrpl.wallet import Wallet | ||
|
|
||
| _SECRET = "randomsecretkey" | ||
| _LOAN_BROKER_ID = "D1B9DFF432B4F56127BE947281A327B656F202FC1530DD6409D771F7C4CA4F4B" | ||
| _COUNTERPARTY_ADDRESS = "rnFRDVZUV9GmqoUJ65gkaQnMEiAnCdxb2m" | ||
|
|
||
|
|
||
| class TestSign(IntegrationTestCase): | ||
| @test_async_and_sync(globals(), ["xrpl.transaction.autofill_and_sign"]) | ||
| async def test_basic_functionality(self, client): | ||
| loan_issuer = Wallet.create() | ||
| await fund_wallet_async(loan_issuer) | ||
|
|
||
| loan_issuer_signed_txn = await autofill_and_sign( | ||
| LoanSet( | ||
| account=loan_issuer.address, | ||
| loan_broker_id=_LOAN_BROKER_ID, | ||
| principal_requested="100", | ||
| counterparty=_COUNTERPARTY_ADDRESS, | ||
| ), | ||
| client, | ||
| loan_issuer, | ||
| ) | ||
| response = await client.request( | ||
| Sign( | ||
| transaction=loan_issuer_signed_txn, | ||
| signature_target="CounterpartySignature", | ||
| secret=_SECRET, | ||
| ) | ||
| ) | ||
| self.assertTrue(response.is_successful()) | ||
| self.assertTrue(response.result["tx_json"]["CounterpartySignature"] is not None) | ||
| self.assertTrue( | ||
| response.result["tx_json"]["CounterpartySignature"]["SigningPubKey"] | ||
| is not None | ||
| ) | ||
| self.assertTrue( | ||
| response.result["tx_json"]["CounterpartySignature"]["TxnSignature"] | ||
| is not None | ||
| ) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
signmethod will not acceptsignature_target. It'ssign_forthat accepts thesignature_target.sign_foris currently not working in rippled as expected and as discussed offline, feel free to log Github but to add support for signature_target insign_forandsubmit_multisignedmethods.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both
signandsubmitmethods accept thesignature_targetfield in their inputs. Both of them make use of a common parsing method: https://github.com/XRPLF/rippled/blob/4565cc280bf2d91f8f88ef74cc807ece4c91a243/src/xrpld/rpc/detail/RPCCall.cpp#L1000This is also the reason my PR changes work correctly and pass the integration tests.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah my bad, yes,
signature_targetis required in sign method, when we want to fill in CounterpartySignature (non-multisigning case).