-
Notifications
You must be signed in to change notification settings - Fork 41
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
Release Candidate v5.0.10 #890
Conversation
Fix JS tests and publish script
Cross-compile ErgoScript compiler to JS
Add Sigma.JS types
* CI: run js tests and publish snapshots * CI: add npm publishing tag * CI: fix ci.yml file * CI: adjust npm setup step * CI: temporarily skip non js related steps * CI: set node registry URL * CI: use nodejs v20 * CI: add stable release * CI: remove npm cache * CI: fix npm caching issues * CI: add cache dependency path * remove accidentally committed yarn.lock file
* add ErgoTree `template` and `templateHex` method and fix type exporting * Simplify package installing instructions
ErgoTree template
* @param hex a hexadecimal string representing the serialized ErgoTree | ||
*/ | ||
def fromHex(hex: String): ErgoTree = { | ||
val bytes = Base16.decode(hex).get |
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.
This .get is not safe, and caught everywhere (and interface method calling it not exposing exceptions). Better return Try[ErgoTree]
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.
For performance Try is not used in sigma, exceptions are thrown everywhere, which gives good visibility into full stack.
Here, when decode result is Failure, will just throw the actual exception with full stack trace.
Another reason to not use Try here, is because this method is used form JS wrappers (see js.ErgoTree class), and Try has no good JS equivalent (where exceptions are used for errors).
…plement SecureRandom for js Platform
Secure random for JS
In this release: