Skip to content

dev: add definitions.json generation script #2826

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 27 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
16b2b60
add definitions codec gen
mvadari Nov 14, 2024
e9c9441
fix spacing
mvadari Nov 14, 2024
c7b72a2
remove new field
mvadari Nov 14, 2024
b0ea5fb
clean up
mvadari Nov 14, 2024
3e1756d
pipe to file
mvadari Nov 14, 2024
406ad49
Merge branch 'main' into definitions-generation
mvadari Nov 15, 2024
5d7c1a5
add package.json script
mvadari Nov 15, 2024
9c9ac7f
Merge branch 'main' into definitions-generation
mvadari Nov 18, 2024
6267de4
fix generateModels script
mvadari Nov 18, 2024
85f0f64
clean up
mvadari Nov 18, 2024
f5fe4fe
Merge branch 'main' into definitions-generation
mvadari Dec 13, 2024
b96cdc3
Merge branch 'main' into definitions-generation
mvadari Dec 20, 2024
7ec1ff5
fix Hash192
mvadari Dec 20, 2024
5e4e4b3
Merge branch 'main' into definitions-generation
ckeshava Jan 13, 2025
ee5bae5
Merge branch 'main' into definitions-generation
mvadari Feb 6, 2025
aca417c
switch script to use server_definitions order
mvadari Feb 6, 2025
c6fd141
fix tests
mvadari Feb 6, 2025
0bc8a10
clean up
mvadari Feb 6, 2025
be3f11f
Merge branch 'main' into definitions-generation
mvadari Feb 18, 2025
9abd99a
fix test
mvadari Feb 18, 2025
5922565
fix again
mvadari Feb 18, 2025
da40b84
Merge branch 'main' into definitions-generation
mvadari Feb 26, 2025
0e6a5ec
remove duplicate
mvadari Feb 26, 2025
9cbbd8c
Merge branch 'main' into definitions-generation
ckeshava Mar 17, 2025
078743e
fix test issue
mvadari Mar 18, 2025
81c84f2
update config
mvadari Mar 18, 2025
05a3f8d
fix other test
mvadari Mar 18, 2025
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
5 changes: 2 additions & 3 deletions .ci-config/rippled.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ online_delete=256
[debug_logfile]
/var/log/rippled/debug.log


[ips]
r.ripple.com 51235
[network_id]
0


[rpc_startup]
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"multisign",
"multisigned",
"multisigning",
"Permissioned",
"preauthorization",
"rippletest",
"secp256k1",
Expand Down
3 changes: 2 additions & 1 deletion packages/ripple-binary-codec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"prepublishOnly": "npm test",
"test": "npm run build && jest --verbose false --silent=false ./test/*.test.ts",
"test:browser": "npm run build && karma start ./karma.config.js",
"lint": "eslint . --ext .ts --ext .test.js"
"lint": "eslint . --ext .ts --ext .test.js",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"lint": "eslint . --ext .ts --ext .test.js",
"lint": "eslint . --ext .ts",

Unrelated to this PR: There are no *.test.js files in this sub-directory tree.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this should stay in case there are any in the future.

"generateDefinitions": "node ./tools/generateDefinitions.js"
},
"keywords": [
"ripple",
Expand Down
66 changes: 42 additions & 24 deletions packages/ripple-binary-codec/src/enums/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -913,20 +913,20 @@
[
"IssuerNode",
{
"nth": 27,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": false,
"nth": 27,
"type": "UInt64"
}
],
[
"SubjectNode",
{
"nth": 28,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": false,
"nth": 28,
"type": "UInt64"
}
],
Expand Down Expand Up @@ -1253,10 +1253,10 @@
[
"DomainID",
{
"nth": 34,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": false,
"nth": 34,
"type": "Hash256"
}
],
Expand Down Expand Up @@ -1843,10 +1843,10 @@
[
"CredentialType",
{
"nth": 31,
"isVLEncoded": true,
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": true,
"nth": 31,
"type": "Blob"
}
],
Expand Down Expand Up @@ -2023,13 +2023,23 @@
[
"Subject",
{
"nth": 24,
"isVLEncoded": true,
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": true,
"nth": 24,
"type": "AccountID"
}
],
[
"Number",
{
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": false,
"nth": 1,
"type": "Number"
}
],
[
"TransactionMetaData",
{
Expand Down Expand Up @@ -2323,10 +2333,10 @@
[
"Credential",
{
"nth": 33,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": false,
"nth": 33,
"type": "STObject"
}
],
Expand Down Expand Up @@ -2523,29 +2533,30 @@
[
"AuthorizeCredentials",
{
"nth": 26,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": false,
"nth": 26,
"type": "STArray"
}
],
[
"UnauthorizeCredentials",
{
"nth": 27,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": false,
"nth": 27,
"type": "STArray"
}
],
[
"AcceptedCredentials", {
"nth": 28,
"isVLEncoded": false,
"AcceptedCredentials",
{
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": false,
"nth": 28,
"type": "STArray"
}
],
Expand Down Expand Up @@ -2732,10 +2743,10 @@
[
"CredentialIDs",
{
"nth": 5,
"isVLEncoded": true,
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": true,
"nth": 5,
"type": "Vector256"
}
],
Expand Down Expand Up @@ -2866,6 +2877,7 @@
"Amendments": 102,
"Bridge": 105,
"Check": 67,
"Credential": 129,
"DID": 73,
"DepositPreauth": 112,
"DirectoryNode": 100,
Expand All @@ -2880,7 +2892,6 @@
"NegativeUNL": 78,
"Offer": 111,
"Oracle": 128,
"Credential": 129,
"PayChannel": 120,
"PermissionedDomain": 130,
"RippleState": 114,
Expand Down Expand Up @@ -2910,6 +2921,7 @@
"tecFAILED_PROCESSING": 105,
"tecFROZEN": 137,
"tecHAS_OBLIGATIONS": 151,
"tecHOOK_REJECTED": 153,
"tecINCOMPLETE": 169,
"tecINSUFFICIENT_FUNDS": 159,
"tecINSUFFICIENT_PAYMENT": 161,
Expand Down Expand Up @@ -2968,6 +2980,7 @@
"tecXCHAIN_SELF_COMMIT": 184,
"tecXCHAIN_SENDING_ACCOUNT_MISMATCH": 179,
"tecXCHAIN_WRONG_CHAIN": 176,

"tefALREADY": -198,
"tefBAD_ADD_AUTH": -197,
"tefBAD_AUTH": -196,
Expand All @@ -2990,6 +3003,7 @@
"tefPAST_SEQ": -190,
"tefTOO_BIG": -181,
"tefWRONG_PRIOR": -189,

"telBAD_DOMAIN": -398,
"telBAD_PATH_COUNT": -397,
"telBAD_PUBLIC_KEY": -396,
Expand All @@ -3007,6 +3021,7 @@
"telNO_DST_PARTIAL": -393,
"telREQUIRES_NETWORK_ID": -385,
"telWRONG_NETWORK": -386,

"temARRAY_EMPTY": -253,
"temARRAY_TOO_LARGE": -252,
"temBAD_AMM_TOKENS": -261,
Expand Down Expand Up @@ -3056,6 +3071,7 @@
"temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT": -255,
"temXCHAIN_BRIDGE_NONDOOR_OWNER": -257,
"temXCHAIN_EQUAL_DOOR_ACCOUNTS": -260,

"terFUNDS_SPENT": -98,
"terINSUF_FEE_B": -97,
"terLAST": -91,
Expand All @@ -3069,6 +3085,7 @@
"terPRE_TICKET": -88,
"terQUEUED": -89,
"terRETRY": -99,

"tesSUCCESS": 0
},
"TRANSACTION_TYPES": {
Expand All @@ -3085,8 +3102,8 @@
"CheckCash": 17,
"CheckCreate": 16,
"Clawback": 30,
"CredentialCreate": 58,
"CredentialAccept": 59,
"CredentialCreate": 58,
"CredentialDelete": 60,
"DIDDelete": 50,
"DIDSet": 49,
Expand Down Expand Up @@ -3115,8 +3132,8 @@
"PaymentChannelClaim": 15,
"PaymentChannelCreate": 13,
"PaymentChannelFund": 14,
"PermissionedDomainSet": 62,
"PermissionedDomainDelete": 63,
"PermissionedDomainSet": 62,
"SetFee": 101,
"SetRegularKey": 5,
"SignerListSet": 12,
Expand Down Expand Up @@ -3146,6 +3163,7 @@
"LedgerEntry": 10002,
"Metadata": 10004,
"NotPresent": 0,
"Number": 9,
"PathSet": 18,
"STArray": 15,
"STObject": 14,
Expand Down
Loading
Loading