-
Notifications
You must be signed in to change notification settings - Fork 125
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
TxBuilder: CIP2 MultiAsset variants added #264
Merged
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0e0abe0
TxBuilder: CIP2LargestFirstMultiAsset + improve MultiAsset
rooooooooob ca74d98
TxBuilder: CIP2-RandomImproveMultiAsset
rooooooooob 5786f04
Merge branch 'master' into cip30-multiasset-largest-first
rooooooooob 185abfc
Fix flaky test: tx_builder_cip2_random_improve_multiasset
rooooooooob ddd14ba
Update MultiAsset comments
rooooooooob ae90a00
Merge branch 'master' into cip30-multiasset-largest-first
vsubhuman 1c7538d
Merge branch 'master' into cip30-multiasset-largest-first
vsubhuman 03609e1
Merge branch 'master' into cip30-multiasset-largest-first
vsubhuman c7ecdd2
Merge branch 'master' into cip30-multiasset-largest-first
vsubhuman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 is something I'm seeing everywhere in the rust library, why are we passing values by reference if it is to clone them. Why not make the API take by values and let the user make the right choices with the memory ?
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.
It's for when it's consumed on the JS side via wasm, which is most of our users. Move semantics don't translate very well over to JS/wasm and there's no rust borrow checker to help you over there. If it were a rust-only library I would 100% agree though.
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.
I think maybe we should convert all rust code to idiomatic rust code and make a js api over it so it is good to use on js side.
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.
I see. Well this is a problem inherent to the whole rust library here. so not necessarily something to do in this P. Though I thought I'd just ask the reason and see what the answer would be.
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.
I'm not sure how well we could simply "make a js api over it".
If we go about it by wrappers on the JS side which contain an object in wasm bound by wasm-bindgen we have these cons:
js_sys
has something could help there though, I haven't looked much.If we go about it by having all the data be on the JS side natively then we have the following cons:
If we go about it by having there be idiomatic rust code with separate rust wasm-bindgen annotated newtypes (js-chain libs reference. This is what IOHK did for but this made sense since the rust code was already written and they were just providing a wasm API around it) we have these cons:
All of these also mean doc-comments are harder to auto-gen. Naively doing these wrappers by hand would mean we'd have to copy them manually (instead of wasm-bindgen exposing them automatically) which means they could get out of date easily if they're in two places. If we're doing this via a wasm-bindgen annotated wrapper in rust we could produce whatever wrapper by a macro we could probably extract them but then we're stuck with very 1:1 or formulaic bindings.
But yeah this probably isn't the place to discuss this. We've had a discussion (sparked by this PR) internally in our slack but maybe we want to discuss it in a public issue here instead.
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.
I am opening a public issue for this