Open xeroc opened 5 years ago
Still missing: #947
There was a (IMHO incomplete) PR https://github.com/bitshares/bitshares-core/pull/1133. @xeroc perhaps your new code will make it obsolete.
It was my understanding that the sole purpose of js_operation_serializer
is to describe API data structures in a way that can be parsed by bitshares-js.
If the output of js_operation_serializer
is different from what bitshares-js uses today, that opens up two questions:
operations.js
file in bitshares-js maintained today?js_operation_serializer
still required at all? Or put differently: would it be better/easier/desirable for bitshares-js maintenance if the output of js_operation_serializer
matched operations.js
?@sschiessl-bcp can you comment? Do you need the serializer? Which output format do you need / would you prefer?
The serializer comes it handy for adjusting and should be maintained. I have not checked how it deviates, but I assume it is only in the formatting since we have introduced the prettifier hook.
Best case would be if it matches of course, but it would also be accepable to run the prettifier hook manually once before comparing it.
This pull request was mostly generated by the serializer in this PR: https://github.com/bitshares/bitsharesjs/pull/43/files
Should the serializer produce output identical to that file then?
Should the serializer produce output identical to that file then?
That would probably be the best, I only made changes so that the output is no longer in CoffeeScript but rather in ES/Javascript. Someone else would need to follow up on this.
You can find a quick diff here: http://www.mergely.com/ITVZr6ep/
Ignore the stuff at the top. Down the file, lots of whitespace/wrapping differences that could potentially be resovled by jslint
I only made changes so that the output is no longer in CoffeeScript but rather in ES/Javascript.
There is a document mentioned a step to convert generated coffee script to javascript: https://github.com/bitshares/bitshares-core/issues/1701#issuecomment-482651340
Edited OP to make this a user story.
See #1133 for some steps in the right (I hope) direction.
Mentioned in bitsharesjs: https://github.com/bitshares/bitsharesjs/blob/master/lib/serializer/src/operations.js#L59-L61
// ## Generated code follows
// # programs/js_operation_serializer > npm i -g decaffeinate
// ## -------------------------------
@abitmore thanks for the comment. Closing this pull request.
As commented in #1702 I'd like to keep this open for a complete solution.
i've been involved into adding htlc features to ui so this also affected adding this ops to bitsharesjs. From what i've seen - everything works perfect, except extensions
field of ops. as of now they get converted by default as future_extension
type in js, and in most cases - it didn't work. Extensions in c++ have their own type - struct *_extension_type which could be converted into js i guess instead of generic extension
"constructor" which you now need to write by your own. I can take over this issue in core project as i wanted to connect to core development process and this issue corefer to my interests now in bitshares-ui.
PS. now output of json_operation_serializer
is not usable in bitsharesjs even in any of its PR implementation
There are currently no extensions defined for HTLC operations. The extensions
field is just a placeholder for future extensions to be added. Insofar the representation as future_extension
sounds correct, but I'm not familiar with the js library types.
In any case it would be great if someone from the UI team could take up this issue. You guys know best what you need.
@pmconrad im talking not about htlc concretly here. serializer doesn't handle extensions at all. Now output of this program cannot be used directly in bitsharesjs
As a UI developer I want to have https://github.com/bitshares/bitsharesjs/blob/master/lib/serializer/src/operations.js automatically generated by
js_operations_serializer
from core.Impacts Describe which portion(s) of BitShares Core may be impacted by this bug. Please tick at least one box.
Cross references:
CORE TEAM TASK LIST