Skip to content

Conversation

yilmazbahadir
Copy link
Contributor

@yilmazbahadir yilmazbahadir commented May 28, 2021

This PR is a proposal of breaking down the Transaction.signWith method into smaller methods(corresponding to the steps)

There are three parts of signing:
1- Preparing the byte array
2- Signing the byte array with private key (this happens on hardware wallet in some cases)
3- Preparing the signed raw tx - payload
4- Return SignedTransaction object

* @param {number[]} rawTxSigningBytes - Raw transaction siging bytes
* @returns {number[]} Signature byte array
*/
public static signRawTx(privateKey: string, rawTxSigningBytes: number[]): number[] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the public method use Uint8Array for input and output rather than number[]?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and Tx=>Transaction

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, updated.

@yilmazbahadir yilmazbahadir marked this pull request as ready for review May 28, 2021 13:15
* @param {number[]} rawTxSigningBytes - Raw transaction siging bytes
* @returns {number[]} Signature byte array
*/
public static signRawTx(privateKey: string, rawTxSigningBytes: number[]): number[] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and Tx=>Transaction

@rg911 rg911 changed the base branch from main to dev June 8, 2021 13:32
@fboucquez fboucquez merged commit 81f5397 into symbol:dev Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants