Skip to content

Commit

Permalink
feat: add support for XLS-38d (#417)
Browse files Browse the repository at this point in the history
* update definitions.json

* add XChainCreateBridge test

* get XChainCreateBridge test working

* add XChainCreateClaimID tx

* get XChainCommit working

* add XChainClaim tx

* add models

* comment out unwritten txs

* add test for xchain conversion, fix bugs

* Update definitions.json

* fix typo

* update to handle XChainAddAttestation (and fix everything else)

* fix bugs

* fix unused variable

* rename Bridge -> XChainBridge in models

* add XChainAddAttestation model(s)

* fix import

* rename file

* fix existing tests w/updated rippled, add AccountCreate test

* add CreateAccount AddAttestation test

* add/update models

* export new tx

* fix XChainCommit

* fix XChainAddAttestation

* add XChainModifyBridge tx model

* rename field

* actually export tx

* Update definitions.json

* add XChainModifyBridge binary codec test

* edit changelog

* update RPCs

* make claim attestation destination optional

* make signature reward optional for modify bridge

* update to new rippled changes

* Update definitions.json

* update definitions.json to avoid conflict with amm

* more updates

* update rpcs

* use NestedModel

* make test easier to read

* respond to comments

* add destination tag to XChainClaim

* rename IssuedCurrency -> Issue to match rippled

* add xchain bridge to account objects

* fix account objects filters

* update Issue form

* add validations for XChainCreateBridge

* add validations for XChainModifyBridge

* validate XChainClaim

* add validations for XChainCreateClaimID

* add validations for XChainAddAttestation

* add validations for XChainAccountCreateCommit

* fix more Literal["XRP"] issues

* simplify initializing attestation lists

* Update definitions.json

* rename XChainAddAttestation -> XChainAddAttestationBatch

* add XChainAddClaimAttestation tx

* add XChainAddAccountCreateAttestation tx

* export new txs

* fix types in WasLockingChainSend

* remove XChainAddAttestationBatch

* update definitions

* update to latest version of rippled

* add XChainModifyBridge flag

* Update definitions.json

* add binary codec tests for new txs

* fix validation for XChainCreateClaimID

* add docs

* add bridge to account_objects filters

* update account_objects filters

* improve types

* include tem code in exception message

* update changelog

* bridge transfer snippet

* Update bridge_transfer.py

* fix settings.json

* update ledger_entry

* add tests

* Update definitions.json

* respond to comments

* add getXChainClaimID util

* add more comments

* respond to comments

* improve ledger entry objects
  • Loading branch information
mvadari authored Sep 27, 2023
1 parent 1d6f5e8 commit 10ff296
Show file tree
Hide file tree
Showing 40 changed files with 2,420 additions and 21 deletions.
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@
"asyncio",
"autofills",
"binarycodec",
"Clawback",
"isnumeric",
"keypair",
"keypairs",
"multisign",
"nftoken",
"rippletest",
"ripplex",
"xaddress"
"xaddress",
"xchain"
],
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
}
}
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- Added new syntax for `SetFee` pseudo transaction sent after the [XRPFees](https://xrpl.org/known-amendments.html#xrpfees) amendment. (Backwards compatible)
- Support for [XLS-38d (XChainBridge)](https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-38d-XChainBridge)

### Fixed
- Update request models related to AMM
Expand All @@ -25,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [2.1.0] - 2023-07-24
### Fixed
- Replaced alias for `classic_address` with separate property to work around this mypy issue:
- Replaced alias for `classic_address` with separate property to work around this mypy issue:
https://github.com/python/mypy/issues/6700

## [2.0.0] - 2023-07-05
Expand Down
105 changes: 105 additions & 0 deletions snippets/bridge_transfer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
"""CLI command for setting up a bridge."""

from pprint import pprint
from time import sleep

from xrpl.account import does_account_exist, get_balance
from xrpl.clients import JsonRpcClient
from xrpl.models import (
AccountObjects,
AccountObjectType,
XChainAccountCreateCommit,
XChainBridge,
XChainCommit,
XChainCreateClaimID,
)
from xrpl.transaction import submit_and_wait
from xrpl.utils import get_xchain_claim_id, xrp_to_drops
from xrpl.wallet import Wallet, generate_faucet_wallet

locking_client = JsonRpcClient("https://sidechain-net1.devnet.rippletest.net:51234")
issuing_client = JsonRpcClient("https://sidechain-net2.devnet.rippletest.net:51234")

locking_chain_door = "rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4"
bridge_data = locking_client.request(
AccountObjects(account=locking_chain_door, type=AccountObjectType.BRIDGE)
).result["account_objects"][0]
bridge = XChainBridge.from_xrpl(bridge_data["XChainBridge"])
print(bridge)

print("Funding a wallet via the faucet on the locking chain...")
wallet1 = generate_faucet_wallet(locking_client, debug=True)
print(wallet1)
wallet2 = Wallet.create()

print(f"Creating {wallet2.classic_address} on the issuing chain via the bridge...")

fund_tx = XChainAccountCreateCommit(
account=wallet1.classic_address,
xchain_bridge=bridge,
signature_reward=bridge_data["SignatureReward"],
destination=wallet2.classic_address,
amount=str(int(bridge_data["MinAccountCreateAmount"]) * 2),
)
fund_response = submit_and_wait(fund_tx, locking_client, wallet1)
pprint(fund_response.result)


print("Waiting for the attestation to go through on the issuing chain...")
ledgers_waited = 0
MAX_LEDGERS_WAITED = 5
while ledgers_waited < MAX_LEDGERS_WAITED:
sleep(4)
if does_account_exist(wallet2.classic_address, issuing_client):
print(
f"Destination account {wallet2.classic_address} has been created via the "
"bridge"
)
initial_balance = get_balance(wallet2.classic_address, issuing_client)
break

ledgers_waited += 1
if ledgers_waited == MAX_LEDGERS_WAITED:
raise Exception("Destination account creation via the bridge failed.")

print(
"Submitting XChainCreateClaimID transaction on the issuing chain to get an "
"XChainOwnedClaimID for the transfer..."
)
create_claim_id_tx = XChainCreateClaimID(
account=wallet2.classic_address,
xchain_bridge=bridge,
signature_reward=bridge_data["SignatureReward"],
other_chain_source=wallet1.classic_address,
)
create_claim_id_result = submit_and_wait(create_claim_id_tx, issuing_client, wallet2)
pprint(create_claim_id_result.result)

# Extract new sequence number from metadata
xchain_claim_id = get_xchain_claim_id(create_claim_id_result.result["meta"])

# XChainCommit

print("Sending XChainCommit tx to lock the funds for transfer...")
commit_tx = XChainCommit(
account=wallet1.classic_address,
amount=xrp_to_drops(1),
xchain_bridge=bridge,
xchain_claim_id=xchain_claim_id,
other_chain_destination=wallet2.classic_address,
)
commit_result = submit_and_wait(commit_tx, locking_client, wallet1)
pprint(commit_result.result)

print("Waiting for the attestation to go through on the issuing chain...")
ledgers_waited = 0
while ledgers_waited < MAX_LEDGERS_WAITED:
sleep(4)
current_balance = get_balance(wallet2.classic_address, issuing_client)
if current_balance != initial_balance:
print("Transfer is complete!")
break

ledgers_waited += 1
if ledgers_waited == MAX_LEDGERS_WAITED:
raise Exception("Bridge transfer failed.")
2 changes: 1 addition & 1 deletion snippets/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
paths = path_response.result["alternatives"][0]["paths_computed"]
print(paths)

# # Create a Payment to send money from wallet to destination_account using path
# Create a Payment to send money from wallet to destination_account using path
payment_tx = Payment(
account=wallet.address,
amount=destination_amount,
Expand Down
183 changes: 183 additions & 0 deletions tests/unit/core/binarycodec/fixtures/data/codec-fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -4450,6 +4450,189 @@
"Sequence": 62
}
},
{
"binary": "1200302200000000240000000168400000000000000A601D40000000000003E8601E400000000000271073210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020744630440220101BCA4B5B5A37C6F44480F9A34752C9AA8B2CDF5AD47E3CB424DEDC21C06DB702206EEB257E82A89B1F46A0A2C7F070B0BD181D980FF86FE4269E369F6FC7A270918114B5F762798A53D543A014CAF8B297CFF8F2F937E8011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000",
"json": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"XChainBridge": {
"LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL",
"LockingChainIssue": {"currency": "XRP"},
"IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
"IssuingChainIssue": {"currency": "XRP"}
},
"Fee": "10",
"Flags": 0,
"MinAccountCreateAmount": "10000",
"Sequence": 1,
"SignatureReward": "1000",
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"TransactionType": "XChainCreateBridge",
"TxnSignature": "30440220101BCA4B5B5A37C6F44480F9A34752C9AA8B2CDF5AD47E3CB424DEDC21C06DB702206EEB257E82A89B1F46A0A2C7F070B0BD181D980FF86FE4269E369F6FC7A27091"
}
},
{
"binary": "12002F2200000000240000000168400000000000000A601D40000000000003E8601E400000000000271073210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074473045022100D2CABC1B0E0635A8EE2E6554F6D474C49BC292C995C5C9F83179F4A60634B04C02205D1DB569D9593136F2FBEA7140010C8F46794D653AFDBEA8D30B8750BA4805E58114B5F762798A53D543A014CAF8B297CFF8F2F937E8011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000",
"json": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"XChainBridge": {
"LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL",
"LockingChainIssue": {"currency": "XRP"},
"IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
"IssuingChainIssue": {"currency": "XRP"}
},
"Fee": "10",
"Flags": 0,
"MinAccountCreateAmount": "10000",
"Sequence": 1,
"SignatureReward": "1000",
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"TransactionType": "XChainModifyBridge",
"TxnSignature": "3045022100D2CABC1B0E0635A8EE2E6554F6D474C49BC292C995C5C9F83179F4A60634B04C02205D1DB569D9593136F2FBEA7140010C8F46794D653AFDBEA8D30B8750BA4805E5"
}
},
{
"binary": "1200292280000000240000000168400000000000000A601D400000000000271073210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020744630440220247B20A1B9C48E21A374CB9B3E1FE2A7C528151868DF8D307E9FBE15237E531A02207C20C092DDCC525E583EF4AB7CB91E862A6DED19426997D3F0A2C84E2BE8C5DD8114B5F762798A53D543A014CAF8B297CFF8F2F937E8801214AF80285F637EE4AF3C20378F9DFB12511ACB8D27011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000",
"json": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"XChainBridge": {
"LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL",
"LockingChainIssue": {"currency": "XRP"},
"IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
"IssuingChainIssue": {"currency": "XRP"}
},
"Fee": "10",
"Flags": 2147483648,
"OtherChainSource": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL",
"Sequence": 1,
"SignatureReward": "10000",
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"TransactionType": "XChainCreateClaimID",
"TxnSignature": "30440220247B20A1B9C48E21A374CB9B3E1FE2A7C528151868DF8D307E9FBE15237E531A02207C20C092DDCC525E583EF4AB7CB91E862A6DED19426997D3F0A2C84E2BE8C5DD"
}
},
{
"binary": "12002A228000000024000000013014000000000000000161400000000000271068400000000000000A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074453043021F177323F0D93612C82A4393A99B23905A7E675753FD80C52997AFAB13F5F9D002203BFFAF457E90BDA65AABE8F8762BD96162FAD98A0C030CCD69B06EE9B12BBFFE8114B5F762798A53D543A014CAF8B297CFF8F2F937E8011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000",
"json": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"Amount": "10000",
"XChainBridge": {
"LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL",
"LockingChainIssue": {"currency": "XRP"},
"IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
"IssuingChainIssue": {"currency": "XRP"}
},
"Fee": "10",
"Flags": 2147483648,
"Sequence": 1,
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"TransactionType": "XChainCommit",
"TxnSignature": "3043021F177323F0D93612C82A4393A99B23905A7E675753FD80C52997AFAB13F5F9D002203BFFAF457E90BDA65AABE8F8762BD96162FAD98A0C030CCD69B06EE9B12BBFFE",
"XChainClaimID": "0000000000000001"
}
},
{
"binary": "12002B228000000024000000013014000000000000000161400000000000271068400000000000000A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020744630440220445F7469FDA401787D9EE8A9B6E24DFF81E94F4C09FD311D2C0A58FCC02C684A022029E2EF34A5EA35F50D5BB57AC6320AD3AE12C13C8D1379B255A486D72CED142E8114B5F762798A53D543A014CAF8B297CFF8F2F937E88314550FC62003E785DC231A1058A05E56E3F09CF4E6011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000",
"json": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"Amount": "10000",
"XChainBridge": {
"LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL",
"LockingChainIssue": {"currency": "XRP"},
"IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
"IssuingChainIssue": {"currency": "XRP"}
},
"Destination": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
"Fee": "10",
"Flags": 2147483648,
"Sequence": 1,
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"TransactionType": "XChainClaim",
"TxnSignature": "30440220445F7469FDA401787D9EE8A9B6E24DFF81E94F4C09FD311D2C0A58FCC02C684A022029E2EF34A5EA35F50D5BB57AC6320AD3AE12C13C8D1379B255A486D72CED142E",
"XChainClaimID": "0000000000000001"
}
},
{
"binary": "12002C228000000024000000016140000000000F424068400000000000000A601D400000000000271073210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD0207446304402202984DDE7F0B566F081F7953D7212BF031ACBF8860FE114102E9512C4C8768C77022070113F4630B1DC3045E4A98DDD648CEBC31B12774F7B44A1B8123CD2C9F5CF188114B5F762798A53D543A014CAF8B297CFF8F2F937E88314AF80285F637EE4AF3C20378F9DFB12511ACB8D27011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000",
"json": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"XChainBridge": {
"LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL",
"LockingChainIssue": {"currency": "XRP"},
"IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
"IssuingChainIssue": {"currency": "XRP"}
},
"Amount": "1000000",
"Fee": "10",
"Flags": 2147483648,
"Destination": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL",
"Sequence": 1,
"SignatureReward": "10000",
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"TransactionType": "XChainAccountCreateCommit",
"TxnSignature": "304402202984DDE7F0B566F081F7953D7212BF031ACBF8860FE114102E9512C4C8768C77022070113F4630B1DC3045E4A98DDD648CEBC31B12774F7B44A1B8123CD2C9F5CF18"
}
},
{
"binary": "12002E2400000005201B0000000D30150000000000000006614000000000989680684000000000000014601D40000000000000647121ED1F4A024ACFEBDB6C7AA88DEDE3364E060487EA31B14CC9E0D610D152B31AADC27321EDF54108BA2E0A0D3DC2AE3897F8BE0EFE776AE8D0F9FB0D0B9D64233084A8DDD1744003E74AEF1F585F156786429D2FC87A89E5C6B5A56D68BFC9A6A329F3AC67CBF2B6958283C663A4522278CA162C69B23CF75149AF022B410EA0508C16F42058007640EEFCFA3DC2AB4AB7C4D2EBBC168CB621A11B82BABD86534DFC8EFA72439A49662D744073CD848E7A587A95B35162CDF9A69BB237E72C9537A987F5B8C394F30D81145E7A3E3D7200A794FA801C66CE3775B6416EE4128314C15F113E49BCC4B9FFF43CD0366C23ACD82F75638012143FD9ED9A79DEA67CB5D585111FEF0A29203FA0408015145E7A3E3D7200A794FA801C66CE3775B6416EE4120010130101191486F0B1126CE1205E59FDFDD2661A9FB7505CA70F000000000000000000000000000000000000000014B5F762798A53D543A014CAF8B297CFF8F2F937E80000000000000000000000000000000000000000",
"json": {
"Account": "r9cYxdjQsoXAEz3qQJc961SNLaXRkWXCvT",
"Amount": "10000000",
"AttestationRewardAccount": "r9cYxdjQsoXAEz3qQJc961SNLaXRkWXCvT",
"Destination": "rJdTJRJZ6GXCCRaamHJgEqVzB7Zy4557Pi",
"Fee": "20",
"LastLedgerSequence": 13,
"OtherChainSource": "raFcdz1g8LWJDJWJE2ZKLRGdmUmsTyxaym",
"PublicKey": "ED1F4A024ACFEBDB6C7AA88DEDE3364E060487EA31B14CC9E0D610D152B31AADC2",
"Sequence": 5,
"Signature": "EEFCFA3DC2AB4AB7C4D2EBBC168CB621A11B82BABD86534DFC8EFA72439A49662D744073CD848E7A587A95B35162CDF9A69BB237E72C9537A987F5B8C394F30D",
"SignatureReward": "100",
"SigningPubKey": "EDF54108BA2E0A0D3DC2AE3897F8BE0EFE776AE8D0F9FB0D0B9D64233084A8DDD1",
"TransactionType": "XChainAddAccountCreateAttestation",
"TxnSignature": "03E74AEF1F585F156786429D2FC87A89E5C6B5A56D68BFC9A6A329F3AC67CBF2B6958283C663A4522278CA162C69B23CF75149AF022B410EA0508C16F4205800",
"WasLockingChainSend": 1,
"XChainAccountCreateCount": "0000000000000006",
"XChainBridge": {
"IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"IssuingChainIssue": {
"currency": "XRP"
},
"LockingChainDoor": "rDJVtEuDKr4rj1B3qtW7R5TVWdXV2DY7Qg",
"LockingChainIssue": {
"currency": "XRP"
}
}
}
},
{
"binary": "12002D2400000009201B00000013301400000000000000016140000000009896806840000000000000147121ED7541DEC700470F54276C90C333A13CDBB5D341FD43C60CEA12170F6D6D4E11367321ED0406B134786FE0751717226657F7BF8AFE96442C05D28ACEC66FB64852BA604C7440D0423649E48A44F181262CF5FC08A68E7FA5CD9E55843E4F09014B76E602574741E8553383A4B43CABD194BB96713647FC0B885BE248E4FFA068FA3E6994CF0476407C175050B08000AD35EEB2D87E16CD3F95A0AEEBF2A049474275153D9D4DD44528FE99AA50E71660A15B0B768E1B90E609BBD5DC7AFAFD45D9705D72D40EA10C81141F30A4D728AB98B0950EC3B9815E6C8D43A7D5598314C15F113E49BCC4B9FFF43CD0366C23ACD82F75638012143FD9ED9A79DEA67CB5D585111FEF0A29203FA0408015141F30A4D728AB98B0950EC3B9815E6C8D43A7D5590010130101191486F0B1126CE1205E59FDFDD2661A9FB7505CA70F000000000000000000000000000000000000000014B5F762798A53D543A014CAF8B297CFF8F2F937E80000000000000000000000000000000000000000",
"json": {
"Account": "rsqvD8WFFEBBv4nztpoW9YYXJ7eRzLrtc3",
"Amount": "10000000",
"AttestationRewardAccount": "rsqvD8WFFEBBv4nztpoW9YYXJ7eRzLrtc3",
"Destination": "rJdTJRJZ6GXCCRaamHJgEqVzB7Zy4557Pi",
"Fee": "20",
"LastLedgerSequence": 19,
"OtherChainSource": "raFcdz1g8LWJDJWJE2ZKLRGdmUmsTyxaym",
"PublicKey": "ED7541DEC700470F54276C90C333A13CDBB5D341FD43C60CEA12170F6D6D4E1136",
"Sequence": 9,
"Signature": "7C175050B08000AD35EEB2D87E16CD3F95A0AEEBF2A049474275153D9D4DD44528FE99AA50E71660A15B0B768E1B90E609BBD5DC7AFAFD45D9705D72D40EA10C",
"SigningPubKey": "ED0406B134786FE0751717226657F7BF8AFE96442C05D28ACEC66FB64852BA604C",
"TransactionType": "XChainAddClaimAttestation",
"TxnSignature": "D0423649E48A44F181262CF5FC08A68E7FA5CD9E55843E4F09014B76E602574741E8553383A4B43CABD194BB96713647FC0B885BE248E4FFA068FA3E6994CF04",
"WasLockingChainSend": 1,
"XChainBridge": {
"IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"IssuingChainIssue": {
"currency": "XRP"
},
"LockingChainDoor": "rDJVtEuDKr4rj1B3qtW7R5TVWdXV2DY7Qg",
"LockingChainIssue": {
"currency": "XRP"
}
},
"XChainClaimID": "0000000000000001"
}
},
{
"binary": "12002315000A2200000000240015DAE161400000000000271068400000000000000A6BD5838D7EA4C680000000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C7321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B87440B3154D968314FCEB58001E1B0C3A4CFB33DF9FF6C73207E5EAEB9BD07E2747672168E1A2786D950495C38BD8DEE3391BF45F3008DD36F4B12E7C07D82CA5250E8114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A",
"json": {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/core/binarycodec/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,14 @@ def test_xaddress_xaddr_and_matching_source_tag(self):


class TestMainFixtures(TestCase):
maxDiff = 1000
maxDiff = None

def _check_binary_and_json(self, test):
test_binary = test["binary"]
test_json = test["json"]
with self.subTest(test_binary=test_binary, test_json=test_json):
self.assertEqual(encode(test_json), test_binary)
self.assertEqual(decode(test_binary), test_json)
self.assertEqual(encode(test_json), test_binary)

def _check_xaddress_jsons(self, test):
x_json = test["xjson"]
Expand Down
Loading

0 comments on commit 10ff296

Please sign in to comment.