Skip to content

Commit

Permalink
Define contract spec for Hash; adds instruction for XDR-gen (#361)
Browse files Browse the repository at this point in the history
* Define contract spec for Hash

* Add instruction for xdr regeneration
  • Loading branch information
jayz22 committed Apr 15, 2024
1 parent a80c899 commit d013877
Show file tree
Hide file tree
Showing 7 changed files with 226 additions and 30 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,23 @@ stellar-xdr decode --type BucketEntry --input stream-framed --output json-format
```

License: Apache-2.0


### For Developers: How to Regenerate From XDR
To regenerate types from XDR definitions
1. Update XDR definitions
```concole
git submodule update --init --remote
```
The `--init` flag is only required for the first time setting up the local project.
`--remote` flag will make sure to fetch the latest changes from from the remote-tracking branches `curr` and `next` at [stellar/stellar-xdr].

**_NOTE:_** if you had multiple remotes specified in the submodules (e.g. one tracking `stellar/stellar-xdr`, the other tracking `your-fork/stellar-xdr`),
make sure the remote that tracks [stellar/stellar-xdr] match with what's specifies in the `.git/config` or `.gitsubmodules` (with `.git/config` taking precedence. If neither file specifies it, then `origin` is used).

2. Recompile and test
```console
make
```

When the regenerated types are ready to be merged, make sure to commit the regenerated code file `src/curr/generated.rs`, `src/next/generated.rs`, the version string file `xdr/curr-version`, `xdr/next-version`, as well as the submodule files `xdr/curr`, `xdr/next`.
Loading

0 comments on commit d013877

Please sign in to comment.