Skip to content
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

feat: add support for current sidechain design #2039

Merged
merged 137 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from 129 commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
7719902
Update definitions.json
mvadari Jul 11, 2022
3a93f60
add new st types
mvadari Jul 11, 2022
0286b81
add tests
mvadari Jul 11, 2022
9d58400
add XChainClaim tx
mvadari Jul 12, 2022
2928229
add XChainCommit tx
mvadari Jul 12, 2022
caddad7
add XChainCreateBridge tx
mvadari Jul 12, 2022
2777258
add XChainCreateClaimID tx
mvadari Jul 12, 2022
901a0e6
update definitions.json
mvadari Jul 19, 2022
6508d04
rename Bridge -> XChainBridge in binary codec, fix tests
mvadari Jul 19, 2022
48214a9
rename Bridge -> XChainBridge in models
mvadari Jul 19, 2022
ac88bf3
add codec support for XChainAddAttestation
mvadari Jul 19, 2022
492de32
add XChainAddAttestation model
mvadari Jul 19, 2022
c371a38
undo debugging change
mvadari Jul 19, 2022
0079600
fix linting issues
mvadari Jul 19, 2022
c29319a
update definitions.json for new rippled code, add new tests/update ol…
mvadari Jul 31, 2022
2c658fe
add/update models
mvadari Jul 31, 2022
dab0667
fix models
mvadari Jul 31, 2022
c4dd6fb
fix bugs
mvadari Jul 31, 2022
58657f3
fix more things
mvadari Jul 31, 2022
df80702
update history
mvadari Jul 31, 2022
ad4c952
update binary-codec
mvadari Aug 3, 2022
5033555
add XChainModifyBridge model
mvadari Aug 3, 2022
b6ee50f
update RPCs
mvadari Aug 15, 2022
9de54dc
update to latest rippled
mvadari Aug 26, 2022
43bf4b9
more fixes
mvadari Aug 26, 2022
5f97366
fix definitions.json
mvadari Aug 29, 2022
ecffb13
fix spacing
mvadari Aug 29, 2022
9fb741f
update definitions.json to avoid conflict with amm
mvadari Aug 30, 2022
2065e6f
update definitions.json to resolve amm conflicts
mvadari Aug 31, 2022
2dc665e
audit code
mvadari Aug 31, 2022
aa3443a
more updates
mvadari Aug 31, 2022
c26235f
fix renames
mvadari Aug 31, 2022
d41954f
fix linter
mvadari Aug 31, 2022
9673a85
update rpcs
mvadari Sep 1, 2022
bc50c6e
switch to beta version
mvadari Sep 2, 2022
0196ccb
fix copy-paste typo
mvadari Sep 13, 2022
c1de808
add destination tag to XChainClaim
mvadari Oct 4, 2022
96e9750
rename IssuedCurrency -> Issue to match rippled
mvadari Nov 9, 2022
3268a29
update Issue form
mvadari Nov 16, 2022
0347e35
fix account object filters
mvadari Nov 16, 2022
f570ac6
fix issue from typing
mvadari Nov 17, 2022
86ab93a
fix LedgerEntry types
mvadari Dec 13, 2022
315a25b
fix attestation destination type
mvadari Jan 9, 2023
0ac0008
Merge branch 'main' into sidechain-2.5
mvadari Feb 2, 2023
c056ca0
Update definitions.json
mvadari Feb 2, 2023
81eb966
fix tests
mvadari Feb 2, 2023
6b20053
rename XChainAddAttestation -> XChainAddAttestationBatch
mvadari Feb 2, 2023
c0c1507
add XChainAddClaimAttestation
mvadari Feb 2, 2023
070413c
add XChainAddAccountCreateAttestation
mvadari Feb 2, 2023
d8930c5
remove XChainAddAttestationBatch
mvadari Feb 6, 2023
764f8d7
fix tests
mvadari Feb 6, 2023
3dbe28c
Merge branch 'main' into sidechain-2.5
mvadari Feb 6, 2023
fbd485f
Merge branch 'main' into sidechain-2.5
mvadari Feb 6, 2023
2cb81b2
update definitions
mvadari Feb 7, 2023
33b02ee
fix attestation txns
mvadari Feb 7, 2023
6ca13bc
fix attestation object
mvadari Feb 7, 2023
82d0d12
add validate for new txs
mvadari Feb 7, 2023
61afad3
fix linter warnings
mvadari Feb 7, 2023
b41d671
Merge branch 'main' into sidechain-2.5
mvadari Feb 7, 2023
c3bb4d9
add Bridge ledger object
mvadari Feb 14, 2023
218ca41
add XChainOwnedClaimID ledger object
mvadari Feb 14, 2023
6c03eec
add XChainOwnedCreateAccountClaimID ledger object
mvadari Feb 14, 2023
a3aa1f8
Merge branch 'main' into sidechain-2.5
mvadari Feb 14, 2023
c52160c
update account_objects
mvadari Feb 14, 2023
38a313b
update models to latest rippled
mvadari Feb 14, 2023
7057b60
fix minor issues
mvadari Feb 14, 2023
f9957c5
fix bridge ledger_entry
mvadari Feb 14, 2023
f564512
add XChainModifyBridge flag
mvadari Feb 14, 2023
2c15d2c
fix linter errors
mvadari Feb 15, 2023
df0d327
Update definitions.json
mvadari Feb 15, 2023
8c83a12
add rbc tests for the new txs
mvadari Feb 15, 2023
dd841c9
update validateXChainModifyBridge
mvadari Feb 15, 2023
d29bdbb
add validate methods to other xchain txs
mvadari Feb 15, 2023
34a01cf
Merge branch 'main' into sidechain-2.5
mvadari Feb 15, 2023
e69d391
fix isXChainBridge
mvadari Feb 15, 2023
4693c91
fix errors
mvadari Feb 15, 2023
28ad836
fix isIssue typing
mvadari Feb 21, 2023
fa8fa7c
Merge branch 'main' into sidechain-2.5
mvadari Feb 21, 2023
596a2df
Merge branch 'main' into sidechain-2.5
mvadari Feb 21, 2023
07b784b
fix model types
mvadari Apr 5, 2023
39e2551
Merge branch 'main' into sidechain-2.5
mvadari Apr 5, 2023
0a904d0
update changelog
mvadari Apr 5, 2023
a1541d5
switch prepare to prepublishOnly
mvadari Apr 5, 2023
7da0283
fix test
mvadari Apr 5, 2023
50e2e03
add docs
mvadari Apr 5, 2023
89d49dd
Merge branch 'main' into sidechain-2.5
mvadari Apr 11, 2023
c38731a
fix AccountObjectsType filter
mvadari Apr 28, 2023
a5d2ee1
export common types
mvadari Apr 28, 2023
866c2ea
fix account_objects filter
mvadari Apr 28, 2023
e66eaef
Merge branch 'main' into sidechain-2.5
mvadari May 1, 2023
63ce462
fix linter error
mvadari May 1, 2023
49b4387
fix types
mvadari May 1, 2023
7120416
Merge branch 'main' into sidechain-2.5
mvadari May 1, 2023
dbd246e
update LedgerEntry
mvadari May 10, 2023
2c35c18
Merge branch 'main' into sidechain-2.5
mvadari May 10, 2023
7b97078
Merge branch 'main' into sidechain-2.5
mvadari May 16, 2023
5896343
Merge branch 'main' into sidechain-2.5
mvadari May 16, 2023
8295704
Merge branch 'main' into sidechain-2.5
mvadari May 31, 2023
a98610c
Merge branch 'main' into sidechain-2.5
mvadari May 31, 2023
f4523b9
add sidechain faucet info
mvadari Jun 9, 2023
80d7dbd
fix typing issues
mvadari Jun 9, 2023
2be713e
add snippet
mvadari Jun 9, 2023
ba6b80c
fix linter issues
mvadari Jun 9, 2023
d5030f3
improve snippet
mvadari Jun 9, 2023
9e6c399
Merge branch 'main' into sidechain-2.5
mvadari Jun 20, 2023
03864c8
undo bad typing changes
mvadari Jun 20, 2023
16b0f0b
fix spacing issues
mvadari Jun 20, 2023
8865f4c
Merge branch 'main' into sidechain-2.5
mvadari Jun 23, 2023
f5ea85d
Merge branch 'main' into sidechain-2.5
mvadari Jun 26, 2023
37a0d57
Merge branch 'main' into sidechain-2.5
mvadari Jun 28, 2023
ce4bbdc
Merge branch 'main' into sidechain-2.5
mvadari Jul 10, 2023
5171f15
Merge branch 'main' into sidechain-2.5
mvadari Jul 11, 2023
f194eaf
update ledger_entry
mvadari Aug 15, 2023
c765bc7
Merge branch 'main' into sidechain-2.5
mvadari Aug 15, 2023
2120af3
Merge branch 'main' into sidechain-2.5
mvadari Aug 24, 2023
ff928e6
remove AMMDelete tests for now
mvadari Aug 24, 2023
ca1db33
Update definitions.json
mvadari Sep 14, 2023
633cc09
Merge branch 'main' into sidechain-2.5
mvadari Sep 14, 2023
007279d
fix unit tests
mvadari Sep 14, 2023
7fd24c1
convert createValidate script to JS
mvadari Sep 14, 2023
bf571f6
fix merge issues + rippled mismatches
mvadari Sep 14, 2023
da35e89
Merge branch 'main' into sidechain-2.5
mvadari Sep 14, 2023
519e8f0
remove unneeded linter ignores
mvadari Sep 14, 2023
c2a10fc
respond to comments
mvadari Sep 15, 2023
58db930
Merge branch 'main' into sidechain-2.5
mvadari Sep 18, 2023
84a8048
more snippet fixes
mvadari Sep 20, 2023
6594c19
make validate functions more readable
mvadari Sep 21, 2023
21fc889
fix error message
mvadari Sep 21, 2023
94afb96
add getXChainClaimID method to parse metadata
mvadari Sep 21, 2023
75fb8e4
fix linter issues
mvadari Sep 21, 2023
29f146f
re-add linter rules
mvadari Sep 21, 2023
7b9dadf
clean up common
mvadari Sep 21, 2023
b75c240
fix getXChainClaimID test
mvadari Sep 21, 2023
7d7f198
fix tests
mvadari Sep 21, 2023
2acf8d9
return undefined for failed tx
mvadari Sep 21, 2023
3896e52
fix copy-paste error
mvadari Sep 21, 2023
1a7713b
test: add model tests for new sidechain transactions (#2059)
mvadari Sep 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
{
"editor.tabSize": 2,
"cSpell.words": [
"altnet",
"Autofills",
"Clawback",
"hostid",
"keypair",
"keypairs",
"multisign",
"multisigned",
"multisigning",
"preauthorization",
"rippletest",
JST5000 marked this conversation as resolved.
Show resolved Hide resolved
"secp256k1",
"Setf"
"Setf",
"Sidechains",
"xchain"
],
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
Expand Down
2 changes: 2 additions & 0 deletions packages/ripple-binary-codec/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# ripple-binary-codec Release History

## Unreleased
### Added
- Support for the XChainBridge amendment.

## 1.9.0 (2023-08-24)

Expand Down
249 changes: 248 additions & 1 deletion packages/ripple-binary-codec/src/enums/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"UInt384": 22,
"UInt512": 23,
"Issue": 24,
"XChainBridge": 25,
"Transaction": 10001,
"LedgerEntry": 10002,
"Validation": 10003,
Expand All @@ -35,8 +36,11 @@
"Ticket": 84,
"SignerList": 83,
"Offer": 111,
JST5000 marked this conversation as resolved.
Show resolved Hide resolved
"Bridge": 105,
"LedgerHashes": 104,
"Amendments": 102,
"XChainOwnedClaimID": 113,
"XChainOwnedCreateAccountClaimID": 116,
"FeeSettings": 115,
"Escrow": 117,
"PayChannel": 120,
Expand Down Expand Up @@ -233,6 +237,16 @@
"type": "UInt8"
}
],
[
"WasLockingChainSend",
{
"nth": 19,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "UInt8"
}
],
[
"LedgerEntryType",
{
Expand Down Expand Up @@ -983,6 +997,36 @@
"type": "UInt64"
}
],
[
"XChainClaimID",
{
"nth": 20,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "UInt64"
}
],
[
"XChainAccountCreateCount",
{
"nth": 21,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "UInt64"
}
],
mvadari marked this conversation as resolved.
Show resolved Hide resolved
[
"XChainAccountClaimCount",
{
"nth": 22,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "UInt64"
}
],
[
"EmailHash",
{
Expand Down Expand Up @@ -1583,6 +1627,26 @@
"type": "Amount"
}
],
[
"SignatureReward",
{
"nth": 29,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "Amount"
}
],
[
"MinAccountCreateAmount",
{
"nth": 30,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "Amount"
}
],
[
"LPTokenBalance",
{
Expand Down Expand Up @@ -1933,6 +1997,66 @@
"type": "AccountID"
}
],
[
"OtherChainSource",
{
"nth": 18,
"isVLEncoded": true,
"isSerialized": true,
"isSigningField": true,
"type": "AccountID"
}
],
[
"OtherChainDestination",
{
"nth": 19,
"isVLEncoded": true,
"isSerialized": true,
"isSigningField": true,
"type": "AccountID"
}
],
[
"AttestationSignerAccount",
{
"nth": 20,
"isVLEncoded": true,
"isSerialized": true,
"isSigningField": true,
"type": "AccountID"
}
],
[
"AttestationRewardAccount",
{
"nth": 21,
"isVLEncoded": true,
"isSerialized": true,
"isSigningField": true,
"type": "AccountID"
}
],
[
"LockingChainDoor",
{
"nth": 22,
"isVLEncoded": true,
"isSerialized": true,
"isSigningField": true,
"type": "AccountID"
}
],
[
"IssuingChainDoor",
{
"nth": 23,
"isVLEncoded": true,
"isSerialized": true,
"isSigningField": true,
"type": "AccountID"
}
],
[
"Indexes",
{
Expand Down Expand Up @@ -1983,6 +2107,26 @@
"type": "PathSet"
}
],
[
"LockingChainIssue",
{
"nth": 1,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "Issue"
}
],
[
"IssuingChainIssue",
{
"nth": 2,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "Issue"
}
],
[
"Asset",
{
Expand All @@ -2003,6 +2147,16 @@
"type": "Issue"
}
],
[
"XChainBridge",
{
"nth": 1,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "XChainBridge"
}
],
mvadari marked this conversation as resolved.
Show resolved Hide resolved
[
"TransactionMetaData",
{
Expand Down Expand Up @@ -2243,6 +2397,46 @@
"type": "STObject"
}
],
[
"XChainClaimProofSig",
{
"nth": 28,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "STObject"
}
],
[
"XChainCreateAccountProofSig",
{
"nth": 29,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "STObject"
}
],
[
"XChainClaimAttestationCollectionElement",
{
"nth": 30,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "STObject"
}
],
[
"XChainCreateAccountAttestationCollectionElement",
{
"nth": 31,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "STObject"
}
],
[
"Signers",
{
Expand Down Expand Up @@ -2393,6 +2587,26 @@
"type": "STArray"
}
],
[
"XChainClaimAttestations",
{
"nth": 21,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "STArray"
}
],
[
"XChainCreateAccountAttestations",
{
"nth": 22,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "STArray"
}
],
[
"AuthAccounts",
{
Expand Down Expand Up @@ -2461,6 +2675,12 @@
"temSEQ_AND_TICKET": -263,
"temBAD_NFTOKEN_TRANSFER_FEE": -262,
"temBAD_AMM_TOKENS": -261,
"temXCHAIN_EQUAL_DOOR_ACCOUNTS": -260,
"temXCHAIN_BAD_PROOF": -259,
"temXCHAIN_BRIDGE_BAD_ISSUES": -258,
"temXCHAIN_BRIDGE_NONDOOR_OWNER": -257,
"temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT": -256,
"temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT": -255,

"tefFAILURE": -199,
"tefALREADY": -198,
Expand Down Expand Up @@ -2497,6 +2717,7 @@
"terQUEUED": -89,
"terPRE_TICKET": -88,
"terNO_AMM": -87,
"terSUBMITTED": -86,

"tesSUCCESS": 0,

Expand Down Expand Up @@ -2538,6 +2759,7 @@
"tecKILLED": 150,
"tecHAS_OBLIGATIONS": 151,
"tecTOO_SOON": 152,
"tecHOOK_ERROR": 153,
"tecMAX_SEQUENCE_REACHED": 154,
"tecNO_SUITABLE_NFTOKEN_PAGE": 155,
"tecNFTOKEN_BUY_SELL_MISMATCH": 156,
Expand All @@ -2553,7 +2775,24 @@
"tecAMM_EMPTY": 166,
"tecAMM_NOT_EMPTY": 167,
"tecAMM_ACCOUNT": 168,
"tecINCOMPLETE": 169
"tecINCOMPLETE": 169,
"tecXCHAIN_BAD_TRANSFER_ISSUE": 170,
"tecXCHAIN_NO_CLAIM_ID": 171,
"tecXCHAIN_BAD_CLAIM_ID": 172,
"tecXCHAIN_CLAIM_NO_QUORUM": 173,
"tecXCHAIN_PROOF_UNKNOWN_KEY": 174,
"tecXCHAIN_CREATE_ACCOUNT_NONXRP_ISSUE": 175,
"tecXCHAIN_WRONG_CHAIN": 176,
"tecXCHAIN_REWARD_MISMATCH": 177,
"tecXCHAIN_NO_SIGNERS_LIST": 178,
"tecXCHAIN_SENDING_ACCOUNT_MISMATCH": 179,
"tecXCHAIN_INSUFF_CREATE_AMOUNT": 180,
"tecXCHAIN_ACCOUNT_CREATE_PAST": 181,
"tecXCHAIN_ACCOUNT_CREATE_TOO_MANY": 182,
"tecXCHAIN_PAYMENT_FAILED": 183,
"tecXCHAIN_SELF_COMMIT": 184,
"tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR": 185,
"tecXCHAIN_CREATE_ACCOUNT_DISABLED": 186
},
"TRANSACTION_TYPES": {
"Invalid": -1,
Expand Down Expand Up @@ -2592,6 +2831,14 @@
"AMMVote": 38,
"AMMBid": 39,
"AMMDelete": 40,
"XChainCreateClaimID": 41,
"XChainCommit": 42,
"XChainClaim": 43,
"XChainAccountCreateCommit": 44,
"XChainAddClaimAttestation": 45,
"XChainAddAccountCreateAttestation": 46,
"XChainModifyBridge": 47,
"XChainCreateBridge": 48,
"EnableAmendment": 100,
"SetFee": 101,
"UNLModify": 102
Expand Down
Loading
Loading