-
Notifications
You must be signed in to change notification settings - Fork 11
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
Stellar XDR Types #38
Comments
Can build some XDR here: https://www.stellar.org/laboratory/#txbuilder?network=test |
Can confirm we use https://github.com/stellar/xdrgen. |
This is awesome. I just learned today that parts of stellar are built in rust and was curious to know if you all had put something like this together already 👍 |
@robertDurst What does that mean? Can it generate rust code? |
@correlator nope, none of our codebase is rust -- at least not until I get good enough to push for change 😁 @kbacha so I talked to one of our devs and this is what we use for xdrgen for various languages -- js, go, and a couple others. This is different than Rust's XDRGEN because that XDRGEN isn't adapted or built for specific encodings or definitions for xdr within the stellar codebase. I just got the lowdown from one of our devs on how to get started adding rust support https://github.com/stellar/xdrgen and am going to take this on. |
That's awesome! That's the missing piece and I wasn't getting any feedback on the rust library. Let me know how I can help, I'm actually coming from a ruby background so working in that library looks pretty easy. |
Awesome! I skimmed the code and it looks quite doable -- while I have never written any ruby, this is quite easy to read. Happy to collaborate, the goal here is to ultimately send a PR here for rust support! Going to give this a go myself this weekend. |
Work is being done on this branch https://github.com/kbacha/xdrgen/tree/rust |
Exciting! |
FYI, I have created a crate with generated rust code from the Stellar XDR. I had to hand-modify the XDR input files to get around issues in xdrgen with unnamed unions and structs. I must admit that I have not done in-depth testing, but I have verified the code does decode a CreateAccount transaction correctly. Feel free to comment on the project. |
@thorhs Excellent! I'll take a look in a few weeks. I've been on parental leave caring for my new child. |
They have a set of XDR types here:
https://github.com/stellar/stellar-core/blob/master/src/xdr/Stellar-types.x
We should model them in rust as best as possible and demonstrate the ability to pack and unpack them. The stellar go library has some tests around all xdr here:
https://github.com/stellar/go/tree/master/xdr
I wish they had tests in the core library for it was well☹️ They also appear to duplicate the xdr files into every repo that they are used in, likely because they use xdrgen.
The text was updated successfully, but these errors were encountered: