-
Notifications
You must be signed in to change notification settings - Fork 17
feat:ContractSpec class to parse ScVals #115
Conversation
4550248
to
2ea4a64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple small suggestions, but looks awesome.
5a5adc1
to
5fee3cf
Compare
This adds a new ContractSpec class which is comprised of the spec entries of a contract. This allows the internal user defined types to be accessible making the parsing to and from XDR more accurate. This should be moved to the js-stellar-base, but for now it is best served here for the type support.
5fee3cf
to
4d6dbac
Compare
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
@Shaptic @paulbellamy I removed having the optional typeDef and it simplified everything. I was also able to switch all string comparisons to value comparisons which should improve performance (though I'm sure that's not the bottleneck currently for devs). |
@paulbellamy I went with still having the base64 as it was easiest to copy over from the soroban-cli tests we added for the bindgen. For now I can regenerate the json file manually, but I'll add a script to do it soon. |
@Shaptic Updated after your comments. Definitely could test more errors, but I think the tests are good enough for now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really really awesome work! Excited to get this across the finish line.
Last question: this uses futurenet-compatible XDR, right? I think yes based on the package.json but I want to confirm.
Yep! That is why I ported the CLI's tests! But using this to do the parsing of the generated bindings I was able to get a roundtrip with futurenet (we don't have the tests in CI in that repo yet because we don't want to depend on CI). |
Love it! So are we ready to merge, then? It'd be awesome if you could add a brief changelog entry that matches the format of the others, then I can hit the button |
This adds a new ContractSpec class which is comprised of the spec entries of a contract. This allows the internal user defined types to be accessible making the parsing to and from XDR more accurate. This should be moved to the js-stellar-base, but for now it is best served here for the type support.
This should replace the current parsing logic in the TS bindings currently living in the soroban-tools repo.
Also discussion here: https://gist.github.com/tyvdh/9391482f7490b085b283ea96d2f50b11