-
Notifications
You must be signed in to change notification settings - Fork 117
feat: add support for Batch amendment #757
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
Changes from 74 commits
Commits
Show all changes
86 commits
Select commit
Hold shift + click to select a range
8c1f795
update definitions.json
mvadari ea28bc4
update scripts after rippled refactor
mvadari dbedfdc
add LedgerStateFix
mvadari 703f4c8
add basic batch models
mvadari 429d6fc
add autofill
mvadari 2677584
add autofill tests
mvadari b79c7f7
fix multisign issue, add test
mvadari 2443f4c
rename some tests
mvadari 3fa2294
fix multisign so tests pass
mvadari 5a000f7
improve typing
mvadari 76d3666
improve tests, fix more issues
mvadari 5e7bc74
more cleanup
mvadari 68ba657
more typing improvements
mvadari 7aae9d8
update changelog
mvadari 786e156
add binary codec batch encoding
mvadari 1a8939d
add multi-account batch signing helper function
mvadari c5ea66c
add batch signer combine function
mvadari 41fbe40
move to transaction
mvadari eb0d88b
add tests, fix issues
mvadari ca6caec
fix typing issue
mvadari d3da22a
fix tests
mvadari c441795
Update main.py
mvadari a2dca0e
Merge branch 'main' into batch
mvadari 2378081
Merge branch 'main' into batch
mvadari 27a822f
Merge branch 'main' into batch
mvadari d2119e1
remove BatchTxn field
mvadari f9cbea7
fix tests
mvadari 7d842c6
fix unrelated TicketSequence bug
mvadari 2a632cf
improve autofilling
mvadari 6f1cbed
better flag handling
mvadari 8ca1005
update changelog
mvadari 77fc6e1
fix integration tests
mvadari 0792b3e
handle batch in batch
mvadari a2890a9
get working integration test
mvadari 6ff9c60
Merge branch 'main' into batch
mvadari f29bc15
Merge branch 'main' into batch
mvadari be36119
Merge branch 'main' into batch
mvadari 4157762
Merge branch 'main' into batch
mvadari a637da3
rename field
mvadari 8be504d
more renames
mvadari eb4124d
Merge
mvadari 74cdbb9
Merge branch 'main' into batch
mvadari b130d83
remove transaction_ids
mvadari 2b444e2
fix tests
mvadari 25084c0
Merge branch 'main' into batch
mvadari 874d4f5
add multisign test
mvadari 3dd191c
Merge branch 'main' into batch
mvadari af5eccf
Merge branch 'main' into batch
mvadari 038b5ee
Merge branch 'main' into batch
mvadari dbdc0c9
remove debug lines
mvadari 81b600e
remove LedgerStateFix
mvadari e406f5b
respond to comments
mvadari bff059e
fix linting issue
mvadari 355e806
improve tfInnerBatchTxn stuff
mvadari d20a616
Merge branch 'main' into batch
mvadari 2d31fd9
fix definitions
mvadari 1cb3025
respond to comments
mvadari d25b35f
Merge branch 'main' into batch
mvadari 4d8cdc8
remove debug statement
mvadari 134f7d4
update definitions
mvadari db3bf5f
Merge branch 'main' into batch
mvadari 10050f0
fix flag handling
mvadari d53dc58
fix FlagInterfaces
mvadari b296815
Merge branch 'main' into batch
mvadari 9717619
fix changelog
mvadari a833012
add Batch to non-delegable txs, clean up
mvadari 4c19e62
fix definitions, update amendments in config
mvadari e7b2a57
fix test
mvadari c322632
Merge branch 'main' into batch
mvadari 8182f48
Merge branch 'main' into batch
mvadari bac28c0
fix changelog
mvadari 2496176
clean up changelog
mvadari 7e87781
more changelog cleanup
mvadari cd03c6f
fix typing
mvadari 10a3775
clean up
mvadari 78a8a7e
Merge branch 'main' into batch
mvadari 01ab82f
fix tests
mvadari 876b91a
respond to comments
mvadari fa78532
Merge branch 'main' into batch
mvadari 4389b5c
fix issues
mvadari b6644cf
remove bad test, improve fee calculation
mvadari e1dc2b0
remove unneeded code
mvadari 1eb5234
respond to comments
mvadari 341d91a
fix tests
mvadari a144e60
fix multisig fee calculations
mvadari ccb0446
Merge branch 'main' into batch
mvadari 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
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,51 @@ | ||
| from tests.integration.integration_test_case import IntegrationTestCase | ||
| from tests.integration.it_utils import ( | ||
| sign_and_reliable_submission_async, | ||
| test_async_and_sync, | ||
| ) | ||
| from tests.integration.reusable_values import DESTINATION, WALLET | ||
| from xrpl.asyncio.transaction import autofill | ||
| from xrpl.models import Batch, BatchFlag, Payment | ||
| from xrpl.models.response import ResponseStatus | ||
| from xrpl.transaction.batch_signers import sign_multiaccount_batch | ||
|
|
||
|
|
||
| class TestBatch(IntegrationTestCase): | ||
| @test_async_and_sync(globals()) | ||
| async def test_basic_functionality(self, client): | ||
| payment = Payment( | ||
| account=WALLET.address, | ||
| amount="1", | ||
| destination=DESTINATION.address, | ||
| ) | ||
| batch = Batch( | ||
| account=WALLET.address, | ||
| flags=BatchFlag.TF_ALL_OR_NOTHING, | ||
| raw_transactions=[payment, payment], | ||
| ) | ||
| response = await sign_and_reliable_submission_async(batch, WALLET, client) | ||
| self.assertEqual(response.status, ResponseStatus.SUCCESS) | ||
| self.assertEqual(response.result["engine_result"], "tesSUCCESS") | ||
|
|
||
mvadari marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| @test_async_and_sync(globals(), ["xrpl.transaction.autofill"]) | ||
| async def test_multisign(self, client): | ||
| payment = Payment( | ||
| account=WALLET.address, | ||
| amount="1", | ||
| destination=DESTINATION.address, | ||
| ) | ||
| payment2 = Payment( | ||
| account=DESTINATION.address, | ||
| amount="1", | ||
| destination=WALLET.address, | ||
| ) | ||
| batch = Batch( | ||
| account=WALLET.address, | ||
| flags=BatchFlag.TF_ALL_OR_NOTHING, | ||
| raw_transactions=[payment, payment2], | ||
| ) | ||
| autofilled = await autofill(batch, client, 2) | ||
ckeshava marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| signed = sign_multiaccount_batch(DESTINATION, autofilled) | ||
ckeshava marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| response = await sign_and_reliable_submission_async(signed, WALLET, client) | ||
| self.assertEqual(response.status, ResponseStatus.SUCCESS) | ||
| self.assertEqual(response.result["engine_result"], "tesSUCCESS") | ||
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,27 @@ | ||
| from unittest import TestCase | ||
|
|
||
| from xrpl.models import Batch, BatchFlag, Payment, TransactionFlag | ||
|
|
||
| _ACCOUNT = "r9LqNeG6qHxjeUocjvVki2XR35weJ9mZgQ" | ||
| _DESTINATION = "rH438jEAzTs5PYtV6CHZqpDpwCKQmPW9Cg" | ||
|
|
||
|
|
||
| class TestBatch(TestCase): | ||
| def test_basic(self): | ||
| payment = Payment( | ||
| account=_ACCOUNT, | ||
| amount="1", | ||
| destination=_DESTINATION, | ||
| ) | ||
| batch = Batch( | ||
| account=_ACCOUNT, | ||
| flags=BatchFlag.TF_ALL_OR_NOTHING, | ||
| raw_transactions=[payment, payment], | ||
ckeshava marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ) | ||
| self.assertTrue(batch.is_valid()) | ||
| self.assertTrue( | ||
| batch.raw_transactions[0].has_flag(TransactionFlag.TF_INNER_BATCH_TXN) | ||
| ) | ||
| self.assertTrue( | ||
| batch.raw_transactions[1].has_flag(TransactionFlag.TF_INNER_BATCH_TXN) | ||
| ) | ||
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
Empty file.
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.
Uh oh!
There was an error while loading. Please reload this page.