Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
XDR_BASE_URL_CURR=https://github.com/stellar/stellar-xdr/raw/529d5176f24c73eeccfa5eba481d4e89c19b1181
XDR_BASE_URL_CURR=https://github.com/stellar/stellar-xdr/raw/4b7a2ef7931ab2ca2499be68d849f38190b443ca
XDR_BASE_LOCAL_CURR=xdr/curr
XDR_FILES_CURR= \
Stellar-SCP.x \
Expand All @@ -11,10 +11,11 @@ XDR_FILES_CURR= \
Stellar-contract-env-meta.x \
Stellar-contract-meta.x \
Stellar-contract-spec.x \
Stellar-contract-config-setting.x
Stellar-contract-config-setting.x \
Stellar-exporter.x
XDR_FILES_LOCAL_CURR=$(addprefix xdr/curr/,$(XDR_FILES_CURR))

XDR_BASE_URL_NEXT=https://github.com/stellar/stellar-xdr/raw/8c88608d0a20b01873056a5ec13be245e1f2aa27
XDR_BASE_URL_NEXT=https://github.com/stellar/stellar-xdr/raw/4b7a2ef7931ab2ca2499be68d849f38190b443ca
XDR_BASE_LOCAL_NEXT=xdr/next
XDR_FILES_NEXT= \
Stellar-SCP.x \
Expand All @@ -27,7 +28,8 @@ XDR_FILES_NEXT= \
Stellar-contract-env-meta.x \
Stellar-contract-meta.x \
Stellar-contract-spec.x \
Stellar-contract-config-setting.x
Stellar-contract-config-setting.x \
Stellar-exporter.x
XDR_FILES_LOCAL_NEXT=$(addprefix xdr/next/,$(XDR_FILES_NEXT))

XDRGEN_COMMIT=master
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,22 @@ earlier versions of Node, so the tests need to run on those versions.)

#### Updating XDR definitions

XDR updates are complicated due to the fact that you need workarounds for bugs
in the generator, formatter, or a namespace adjustment.

1. Make sure you have [Docker](https://www.docker.com/) installed and running.
2. `make reset-xdr`
2. Change the commit hash to the right version of [stellar-xdr](https://github.com/stellar/stellar-xdr) and add any filenames that might've been introduced.
3. Run `make reset-xdr`
4. Run `sed -ie s/\"/\'/g types/{curr,next}.d.ts` to minimize the diff (the generator's formatter uses `"` but the repo uses `'`).
5. Move `xdr.Operation` into a hidden namespace to avoid conflicts with the SDK's `Operation`.
6. Add generator workarounds:
* `type Hash = Opaque[]` is a necessary alias that doesn't get generated
* `Hyper`, `UnsignedHyper`, and `ScSpecEventV0` need their signatures
fixed because linting wants an `Array` instead of a naked `[]`.
* Some constants aren't generated correctly (e.g, Ctrl+F `SCSYMBOL_LIMIT` in `src/curr_generated.js`)
7. Finally, make code adjustments related to the XDR (these are usually revealed by running the tests).

As an example PR to follow, [stellar-base#800](https://github.com/stellar/js-stellar-base/pull/800) has detailed steps for each part of the process.

## Usage

Expand Down
Loading