Skip to content
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

New API: get transaction hex without signatures field #1013

Closed
3 of 6 tasks
abitmore opened this issue Jun 3, 2018 · 7 comments
Closed
3 of 6 tasks

New API: get transaction hex without signatures field #1013

abitmore opened this issue Jun 3, 2018 · 7 comments
Assignees
Labels
1b User Story The User Story details a requirement. It may reference a parent Epic. It may reference child Task(s) 2h Accepted Status indicating the solution passed final review, and is ready for implementation 3b Feature Classification indicating the addition of novel functionality to the design 6 API Impact flag identifying the application programing interface (API) feature

Comments

@abitmore
Copy link
Member

abitmore commented Jun 3, 2018

User Story
As a node API user I want features:

  • get hex of a signed transaction (which is current behavior of get_transaction_hex API, if there is no signature in the transaction, there will be a byte with value 00 at the end of the hex);
  • get hex of a transaction without signatures (actually without the signature field), so I can sign it directly.

Additional Context
I've heard of complaints from different people about the extra 00 byte returned by get_transaction_hex API. Not sure how that API is being used by client software, so IMHO it's safer to keep its behavior and add a new API (although don't know whether/how the new API will be used as well).

CORE TEAM TASK LIST

  • Evaluate / Prioritize Feature Request
  • Refine User Stories / Requirements
  • Define Test Cases
  • Design / Develop Solution
  • Perform QA/Testing
  • Update Documentation
@ryanRfox ryanRfox added 1b User Story The User Story details a requirement. It may reference a parent Epic. It may reference child Task(s) 2a Discussion Needed Prompt for team to discuss at next stand up. 3b Feature Classification indicating the addition of novel functionality to the design 6 API Impact flag identifying the application programing interface (API) labels Jun 5, 2018
@windycrypto
Copy link
Member

I am working on multi-sig function of cli_wallet these days, may I take this issue two? @ryanRfox

@oxarbitrage
Copy link
Member

i will say yes. @ryanRfox please make @cifer-lee part of the bitshares organization so we can assign him issues.

@ryanRfox ryanRfox self-assigned this Jun 7, 2018
@ryanRfox ryanRfox added 2d Developing Status indicating currently designing and developing a solution and removed 2a Discussion Needed Prompt for team to discuss at next stand up. labels Jun 7, 2018
@ryanRfox
Copy link
Contributor

ryanRfox commented Jun 7, 2018

Yes @cifer-lee Thank you for claiming this Issue. I have added to the Communit Claims board and marked it In Development. Next, @oxarbitrage I will reach out to @abitmore to add @cifer-lee to the Organization (I don't have access to perform that task).

@abitmore
Copy link
Member Author

abitmore commented Jun 7, 2018

@ryanRfox I've invited @cifer-lee. Write permission will be granted after some time.

@windycrypto
Copy link
Member

windycrypto commented Jun 8, 2018

Thanks Alfredo, Fox and Abit~

@windycrypto
Copy link
Member

windycrypto commented Jun 8, 2018

Seems this can be solved by static_casting signed_transaction to transaction when packing.


For curious, the tail 00 was cause by line 565 of the packing code:

// libraries/fc/include/fc/io/raw.hpp

561     template<typename Stream, typename T>
562     inline void pack( Stream& s, const std::vector<T>& value, uint32_t _max_depth ) {
563        FC_ASSERT( _max_depth > 0 );
564        --_max_depth;
565        fc::raw::pack( s, unsigned_int((uint32_t)value.size()), _max_depth );
566        auto itr = value.begin();
567        auto end = value.end();
568        while( itr != end ) {
569           fc::raw::pack( s, *itr, _max_depth );
570           ++itr;
571        }
572     }

When packing a vector object(as signed_transaction::signatures be), the size will go in first, and as less bytes as the value can be hold.

@ryanRfox ryanRfox added 2h Accepted Status indicating the solution passed final review, and is ready for implementation and removed 2d Developing Status indicating currently designing and developing a solution labels Jun 11, 2018
@oxarbitrage
Copy link
Member

closed by #1038

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1b User Story The User Story details a requirement. It may reference a parent Epic. It may reference child Task(s) 2h Accepted Status indicating the solution passed final review, and is ready for implementation 3b Feature Classification indicating the addition of novel functionality to the design 6 API Impact flag identifying the application programing interface (API) feature
Projects
None yet
Development

No branches or pull requests

4 participants